Skip to content

[Bug]: Not able to update CICD variable during the update installing #65

@andyroode

Description

@andyroode

Describe the bug

During the gsf install of updated package, CICD variables update failed with error
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/develop/api/cicd_variables.py", line 54, in create_variable
raise PackageCICDVariablePolicyError(f"{variable['name']} CI/CD variable used in another package. According "
git_system_follower.errors.PackageCICDVariablePolicyError: DOCKER_REGISTRY CI/CD variable used in another package. According to package manager policy, you cannot use the same variables in different packages

Additional log:
{'DOCKER_REGISTRY': ExtraParam(name='DOCKER_REGISTRY', value='reg2', masked=False)}
SystemParameters(project=<Project id:68891268 path_with_namespace:andy-roode/My-Own-Project>, created_cicd_vars_names=['DOCKER_REGISTRY', 'SECRET_KEY', 'GITLAB_TOKEN', 'ENVGENE_AGE_PRIVATE_KEY', 'ENVGENE_AGE_PUBLIC_KEY', 'PUBLIC_AGE_KEYS', 'IS_OFFSITE', 'GITLAB_RUNNER_TAG_NAME', 'RUNNER_SCRIPT_TIMEOUT'], script_dir=PosixPath('/Users/andyroode/Desktop/qubership_folder/qubership-envgene/gsf_packages/envgene_instance_project/git-system-follower-package/scripts'), is_force=True)
15:16:02.480 An error came out at one stage of installation. Installation envgene_instance_project@1.0.2 aborted.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/install.py", line 211, in install_packages
response = install_package(
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/install.py", line 260, in install_package
response = init(
^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/package/initer.py", line 47, in init
response = run_init_script(
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/package/initer.py", line 61, in run_init_script
response = run_script(
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/package/script.py", line 67, in run_script
response = execute_package_api(
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/package/script.py", line 120, in wrapper
result = func(path, workdir, current_version_dir, *args, **kwargs, module=module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/package/script.py", line 189, in execute_package_api
module.main(params)
File "/Users/andyroode/Desktop/qubership_folder/qubership-envgene/gsf_packages/envgene_instance_project/git-system-follower-package/scripts/init.py", line 29, in main
create_variable(
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/git_system_follower/develop/api/cicd_variables.py", line 54, in create_variable
raise PackageCICDVariablePolicyError(f"{variable['name']} CI/CD variable used in another package. According "
git_system_follower.errors.PackageCICDVariablePolicyError: DOCKER_REGISTRY CI/CD variable used in another package. According to package manager policy, you cannot use the same variables in different packages

To Reproduce

Option: Simple gear;

Version 1.0.0:
init.py:
create_variable(
parameters,
CICDVariable(
name='DOCKER_REGISTRY',
value='reg1',
env='*',
masked=False
),
is_force=True
)

Version 1.0.1:
init.py:
create_variable(
parameters,
CICDVariable(
name='DOCKER_REGISTRY',
value='reg2',
env='*',
masked=False
),
is_force=True
) --> fail

Version

No response

Logs

No response

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions