-
Notifications
You must be signed in to change notification settings - Fork 17
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
Instanciate new empty lists for each instance of WorkflowRepoManager #415
Open
mgoerens
wants to merge
1
commit into
openshift-helm-charts:main
Choose a base branch
from
mgoerens:fix_local_branches_del_error
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Instanciate new empty lists for each instance of WorkflowRepoManager #415
mgoerens
wants to merge
1
commit into
openshift-helm-charts:main
from
mgoerens:fix_local_branches_del_error
Conversation
This file contains 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
mgoerens
changed the title
Instanciate new empty lists for each instance
Instanciate new empty lists for each instance of WorkflowRepoManager
Dec 16, 2024
This was referenced Dec 16, 2024
Previously we were assigning values to attributes on the class level. For list in particular, this had the side effect of leaking values between instances: ``` >>> m = OwnersFileSubmissionsE2ETest() >>> m.repo_manager._WorkflowRepoManager__local_branches_created ['e2e-owners-d376dfa-6d3820eb5c624ddc9066f96f1a69640e'] >>> m.cleanup() >>> m.repo_manager._WorkflowRepoManager__local_branches_created [] >>> m = OwnersFileSubmissionsE2ETest() >>> m.repo_manager._WorkflowRepoManager__local_branches_created ['e2e-owners-d376dfa-6d3820eb5c624ddc9066f96f1a69640e', 'e2e-owners-d376dfa-cc7f8acf1850498cb6c758bc286f2bec'] ``` Using a dataclass for WorkflowRepoManager, we can ensure that empty lists are initialized for each new instance, and attributes values remain independant. Fix openshift-helm-charts#414 Signed-off-by: Matthias Goerens <[email protected]>
mgoerens
force-pushed
the
fix_local_branches_del_error
branch
from
December 20, 2024 14:30
1de8bf0
to
d5af3a5
Compare
This was referenced Dec 20, 2024
This was referenced Dec 20, 2024
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.
Previously we were assigning values to attributes on the class level. For list in particular, this had the side effect of leaking values between instances:
Using a dataclass for WorkflowRepoManager, we can ensure that empty lists are initialized for each new instance, and attributes values remain independant.
Fix #414