-
Notifications
You must be signed in to change notification settings - Fork 1
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
Respect service type in environment and pipeline variable patching, add dry run #37
Respect service type in environment and pipeline variable patching, add dry run #37
Conversation
* add dry run mode pipeline vars * ensure default service value is not serialized for env-vars * ensure that service type of pipeline variables is also evaluated in PartialEq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format your code using rustfmt: cargo fmt
Hi @tobias-richter, First I used the latest pippo version, to verify the issue described. |
Hi @tobias-richter, when I use my unchanged working pippo.json that I used to confirm this issue on main, I ran into a "thread 'main' panicked"
|
|
Sorry, @BerSomBen accidentially closed the PR. I will get in touch with you. I also noticed that kind of issue in one of my environments when the environment variables where wrongly set. |
@BerSomBen the error message is kind of confusing because what is actually the case is that you have a pipeline variable configured for "author" service which is not correct!
I have assigned #38 to you in order to add more resilience in that case. But with that solution every invalid value would also get an "invalid" value when serializing or deserializing. |
…l entry. Add warn message, if there are any invalid entries on CM already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I reviewed the second PR and added tiny improvements to your branch. Please have a look and feel free to merge towards this branch.
When its merged, I'll update the review here
…y-in-env-vars-patching-resilience Add invalid variable service type for environments and pipelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format your code using rustfmt: cargo fmt
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
hi @tobias-richter , i reviewed and tested the changes and I'm fine with it! If there is an invalid variable in the current CM Environment or Pipeline Variables, the next
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
I have detected a bug in the patching of the environment variables.
In the current implementation the check if an environment variable should be removed takes only the name into account but not the actual service type the variable is applied to.
Example
When we first apply the following environment variable:
When removing the service and applying the environment variables with
This led to the state that two environment variables were present in the environment and the old author environment variable was not cleaned up.
I have now changed the implementation and we are now also using the applied service during envaluation what environment variables need to be updated / deleted.
Since the pipeline variables looked like they will also get additional service / steps soon (currently only
build
is available) I have also adjusted the logic for the pipeline variable update.Since I have introduced a
enum
for possible environment variable services and due to the new added service support for pipeline variables I had to separate the environment variables from the pipeline variables.I have now also added an optional
--dry-run
flag which allows a preview of what the environment / pipeline variable step will do.