-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support paths to job files in project.yaml #285
Comments
hey @amberrignell , the language here looks a little funny. I'd love to make sure we're on the same page. monday AM? |
@taylordowns2000 is this issue in the right place? This feels like a Lightning export thing? In a workflow you can specify a path to an expression, so the CLI supports this. Although the CLI does not let you run a project.yaml fie. I don't know the expected relationship between an exported project and a Workflow object (Execution Plan, in runtime parlance). I think this is something we ought to talk through. |
Weirdly, I think this belongs in Kit... Hear me out!
In other words, the CLI allows you to take Lightning JSON and make some files, or it allows you to take some files and make some Lightning JSON. I think the file path stuff should live here. The Lightning "project-as-code" interface is (beautifully) dumb by design and the "wrangling" happens in CLI. |
over on #561 we talked about this:
I think this is still the simplest way to do it. @aleksa-krolls mentioned that this is fairly high priority recently and @mtuchi will probably agree. The open question is whether we want to try to support more flexibility. It will be more complex/expensive to deliver, so the question for Aleksa and Mtuchi might be: "would you run into any major problems if you had two options: (a) monolith project.yaml OR (b) relative-path project.yaml where each job is a If there would be major problems, can you describe how that rigid option B would fail? |
For users who work locally or for certain projects in their GitHub repos, users want to keep their jobs in different .js files and then have the files referenced in their project.yaml files. When OpenFn deploy is called, we need to make sure we get the content of the files and add them to the right section on the project.yaml.
We should advise users to create a job.js file for every job such that for a workflow with 5 steps, we will need 5 jobs.js files. that are referenced in the .yaml file.
cli deploy
and detecting a file path in the yaml, you merge in the real content before sending it to the lightning servercli pull
you get a new copy of theproject.yaml
and theprojectState.json
and compare it to the local copy of theproject.yaml
... you notice that the localproject.yaml
has file paths, and instead of committing the entirely newproject.yaml
to GitHub, you interpret the paths and write to those files.Implementation Note
Instead of putting a path directly in the
body
key (which would also be a string value), we use this pattern instead:Note that this path is relative to the project.yaml, and not the current working directory.
This way we can tell that the body is not available directly under the key much more easily, and leaves room for other features.
For instance, a step that looks like this in the project.yaml
We'd expect users to configure their step this way and cli deploy still works.
This does not apply to exports at the moment. All project exports will be monolithic i.e. job code and other project settings are kept in the same file.
User acceptance criteria
body
is an object, and doesn't have apath
key then we throw an error.The text was updated successfully, but these errors were encountered: