Code Monkey home page Code Monkey logo

godel-conjure-plugin's Introduction

Autorelease

godel-conjure-plugin

godel-conjure-plugin is a godel plugin for conjure-go. The plugin runs conjure-go based on project configuration. It also runs as part of the --verify task and verifies that the running the task would not alter the content of the output directory.

Tasks

  • conjure: runs Conjure generation. Runs for all of the entries specified in the configuration in order. The working directory is set to be the project directory.
  • conjure-publish: publishes IR to a specified destination.

Verify

When run as part of verification that does not apply, the task fails if running the task would alter any of the contents of the output directory. The output directory will not be modified as part of this process. Note that the implementation operates by temporarily making a copy of the output directory. For this reason, one should avoid having large files in the output directory.

Config

The configuration for this plugin is in a file called conjure-plugin.yml. The configuration should be of the following form:

version: 1
projects:
  project-1:
    output-dir: outputDir
    ir-locator: local/conjure-yaml-files
  project-2:
    output-dir: outputDir
    ir-locator: https://host.com/conjure-ir-file.json

The top-level projects is a map where the key is the name of the Conjure task and the value is the configuration for that task. output-dir specifies the base directory into which the output is written. The ir-locator parameter specifies how the IR should be retrieved.

IR locators can specify a local Conjure YAML file, a local directory that contains Conjure YAML files (in which case the IR generated by the input YAML files is used), a URL that points to a Conjure IR file or a local file that specifies Conjure IR.

If the locator is specified as a string, its target is determined as follows:

  • If it starts with a URL scheme ("http://", "https://", etc.), it is considered to be a URL
  • If the specified path exists and is a file, it is assumed to be a Conjure IR file
  • Otherwise, it is assumed to be a Conjure YAML directory

If the inference rules above are not sufficient, then the locator type can be specified explicitly. For example, "localhost:8080/ir.json" will not be inferred to be a remote IR provider because it does not start with a scheme. In order to be used as a remote provider, the type must be specified explicitly:

version: 1
projects:
  project-1:
    output-dir: outputDir
    ir-locator:
      type: remote
      locator: localhost:8080/ir.json

The supported types are remote, yaml and ir-file.

Publish

The conjure-publish task publishes Conjure IR to a location based on the provided arguments. The Conjure IR files that can be published are determined based on the projects defined in conjure-projects block. By default, YAML locator types are considered as possible to publish (because publish workflow most commonly publish IR generated from local YAML). However, publish: true can be set on a project explicitly to allow it to publish its IR.

The publish command uses the Git versioner of distgo to determine the version for the IR and uses distgo's Artifactory publisher to publish the IR to an Artifactory destination.

Here is an example invocation to publish a Conjure definition:

./godelw conjure-publish --group-id=com.palantir.test-group --url https://artifactory.com --repository "$PUBLISH_REPO" --username "$ARTIFACTORY_USERNAME" --password "$ARTIFACTORY_PASSWORD"

The --dry-run flag can be added to print the operation that would be performed (including the upload URL).

godel-conjure-plugin's People

Contributors

adamdehovitz avatar asanderson15 avatar asvoboda avatar bmoylan avatar holtwilkins avatar jamesross3 avatar jhowarth-pal avatar k-simons avatar mglazer avatar nmiyake avatar rzpt avatar splucs avatar svc-autorelease avatar svc-excavator-bot avatar tabboud avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

godel-conjure-plugin's Issues

Misleading error message for missing group-id flag when running publish.

When ./godelw conjure-publish is run without the group-id flag specified, the error message is:

Error: group-id was not specified -- it must be specified in configuration or using a flag

However, there doesn't seem to be a configuration point for actually specifying the group ID. Looks like this was left as a todo here.

I think we should either (1) fix the error message to avoid misleading people here, or (2) support specifying the group ID in the plugin configuration.

Compiled IR ordering not stable

Confirmed with Felipe that the conjure IR compiler can not be trusted to give 100% reproducible ordering, which results in reordered generated code and a failed verify task.

Generating based on published IR should not be affected.

Nondeterministic failures due to missing compiler file

Occasionally, the plugin with a failure like the below:

./godelw conjure
Error: failed to execute [/var/folders/hm/pb6ft_vs5r1604m2z_z1z5ld0808zm/T/_conjureircli/conjure-4.6.1/bin/conjure compile ./conjure/defs /var/folders/hm/pb6ft_vs5r1604m2z_z1z5ld0808zm/T/466488667/out.json]
Output:
: fork/exec /var/folders/hm/pb6ft_vs5r1604m2z_z1z5ld0808zm/T/_conjureircli/conjure-4.6.1/bin/conjure: no such file or directory

This can be resolved by deleting the temp directory so we can try again. We don't know why this happens, but we could be more defensive to it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.