Ignore case in project/group paths when refreshing agent CI access
What does this MR do and why?
Ignores case when refreshing project/group CI access authorisations. Previously, half of the process was case-insensitive (Routable.where_full_path_in
uses LOWER()
), which caused an error to be raised when we tried to parse a configuration entry that had incorrect capitalisation.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
- Create a test project,
my-project
- Create a file to be used as a sample config file,
example.yaml
:
ci_access:
projects:
- id: UPPERCASE/PATH/TO/YOUR/PROJECT # the path should match, but have the wrong case.
access_as:
ci_job: {}
- From the Rails console:
- create an agent -
agent = Clusters::Agents.create!(project: <any project ID>, name: 'test-agent')
- configure the agent with the config file above: -
Clusters::Agents::RefreshAuthorizationService.new(agent, config: File.read('example.yaml')).execute
-
NotNullViolation
should not be raised
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Tiger Watson