feat: #811 Add tracebility comments in Effective Set#1317
Open
KamalArya wants to merge 15 commits into
Open
Conversation
47c7e7f to
f85e46b
Compare
2 tasks
2303461 to
c9188ae
Compare
161e13c to
f3a8bee
Compare
b8155d0 to
be79103
Compare
dac7fa5 to
2c387b7
Compare
2c387b7 to
f3ab24a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
To make it clear where each parameter in the Effective Set comes from, comments should be added next to every value showing its source.
Issue
Fixes #811Breaking Change?
If yes, describe the breaking change and its impact (e.g., API changes, behavior changes, or required updates for users).
Scope / Project
effective set
Implementation Notes
This change is aimed at adding traceability support in the effective set:
Issue: #811
Documentation: https://github.com/Netcracker/qubership-envgene/blob/main/docs/features/calculator-cli.md#version-20-traceability-comments
Approach:
The Parameter object passed during YAML dumping is unwrapped, and origin details are added as comments based on conditions.
Implemented custom representer for Parameter class.
Tests / Evidence
Describe how the changes were verified, including:
Additional Notes
As comments are added to generated credentials.yaml file as well inside effective set, the comment were getting encrypted during SOPS encryption.
Applied fix: switch effective-set credential files only to --encrypted-regex='.*'.
Concretely, surgical change in sops_handler.py and the pre-commit crypt.py:
function get_sops_scope_flag(file_path):
if file_path matches "/effective-set/<...>/credentials.ya?ml"
and filename != "external-credentials.ya?ml":
scope = '--encrypted-regex "."'
else:
scope = '--unencrypted-regex "^type$"' # current behavior, unchanged
function encrypt(file_path, age_public_key):
scope_flag = get_sops_scope_flag(file_path)
run: sops --encrypt --age <age_public_key> <scope_flag> <file_path>
There are changes in internal envgene repository as well