Skip to content
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

persist run record for custom actions that produce outputs #2291

Merged
merged 3 commits into from
Aug 11, 2022

Conversation

VinozzZ
Copy link
Contributor

@VinozzZ VinozzZ commented Aug 9, 2022

What does this change

When a custom action that does not modify bundle resources and is stateless, its run should be recorded in the database if the action produce any outputs.
This PR implements this behavior.

What issue does it fix

Closes #1980

Notes for the reviewer

Checklist

  • Did you write tests?
  • Did you write documentation?
  • Did you change porter.yaml or a storage document record? Update the corresponding schema file.
  • If this is your first pull request, please add your name to the bottom of our Contributors list. Thank you for making Porter better! 🙇‍♀️

Reviewer Checklist

  • Comment with /azp run test-porter-release if a magefile or build script was modified
  • Comment with /azp run porter-integration if it's a non-trivial PR

@VinozzZ VinozzZ requested review from carolynvs and vdice as code owners August 9, 2022 23:49
@carolynvs carolynvs self-assigned this Aug 11, 2022
Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The docs just need a few edits and it's ready to go 👍

stateless: true
modifies: false

getLicense:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you trying to demonstrate that this action will be recorded? It's a bit unclear for this example why you are including an output but then not discussing how actions that generate outputs are recorded.

Maybe split this into two custom actions? Keep myhelp as it was, and then add the getLicense one too, along with a bundle output defined so that you can explain why one is recorded and the other one isn't?


* `description`: Description of the action.
* `stateless`: Indicates that the action is purely informational, that credentials are not required,
and that Porter should not keep track of when this action was last executed.
* `stateless`: Indicates that the action is purely informational and can be executed before the install action runs. It also,means that credentials are not required, and that Porter should not keep track of when this action was last executed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `stateless`: Indicates that the action is purely informational and can be executed before the install action runs. It also,means that credentials are not required, and that Porter should not keep track of when this action was last executed.
* `stateless`: Indicates that the action is purely informational and can be executed before the install action runs.

Now that the logic for when a run should be persisted is more complicated, this sentence is confusing since it doesn't address it fully. How about explaining it only once next to the above example? "Porter will record a run when the action modifies resources, is not stateless, or generates an output."

Signed-off-by: Yingrong Zhao <[email protected]>
@VinozzZ VinozzZ requested a review from carolynvs August 11, 2022 15:55
@VinozzZ VinozzZ merged commit 84e5ae5 into getporter:release/v1 Aug 11, 2022
@VinozzZ VinozzZ deleted the persist-run-record branch August 11, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Record run when a bundle action generates outputs
2 participants