acoustic-carpenter-78188
10/28/2023, 4:45 PMDescription) of an Archived project causes the project state to
change to Active. This is caused by a bug in the updateProjectsFunc function used for the update command.
Type
☑︎ Bug Fix
☐ Feature
☐ Plugin
Are all requirements met?
☑︎ Code completed
☑︎ Smoke tested
☑︎ Unit tests added
☑︎ Code documentation added
☑︎ Any pending items have an associated Issue
Complete description
During project updates, edited, a default project created based on the given configs/flags,
comes with admin.Project_ACTIVE state by default if both activate and archive flags
have not been set.
Then a copy of the target project will be updated based on edited and then used for showing
the diff. In the current implementation, the state of the copy is set to be the same as edited
projects state, which is Project_ACTIVE if no flags are set.
Also, after showing the diff, the edited is used for updating the project. Since it comes
with Project_ACTIVE state by default, the target project will be updated to have Project_ACTIVE
if both activate and archive flags are unset, regardless of the projects previous state.
On this PR, we make sure we set the correct state to both copy and edited by checking
if both activate and archive flags are set/unset. If one of the flags are set, we update target
project state (copy) based on the edited state since it will have the desired state. If both
flags are unset, we set the edited state to be the same as target (copy) state. This way, updating
archived projects will not change their state.
This is a bit hacky IMO. Proper solution would be to refactor project.ConfigProject and this file
in order to separate the logic of setting ConfigProject struct fields from creation of a 'default'
project based on those flags. Having a proper order of precedence between global config,
YAML file input, and the flags for ConfigProject would also be good. Since the changes
would be too big in that case, I have not worked on this kind of solution. However, if needed
I can create follow-up issues and work on them.
Tracking Issue
flyteorg/flyte#4114
Follow-up issue
NA
flyteorg/flytectl
GitHub Actions: Goreleaser
GitHub Actions: Generate documentation
GitHub Actions: Bump Version
✅ 7 other checks have passed
7/10 successful checksacoustic-carpenter-78188
11/01/2023, 1:07 AM