Make setting the hook environment unconditional
What does this MR do?
This one-line change deserves a little explanation. Prior to b9424627, the hook env was set unconditionally. In that commit, the environment was transformed to switch from relative to absolute paths for object directories, etc. This depended on a project
being present, so a conditional was added to the transformation line.
In 52bfd064 we stopped doing that transformation, but the if project
line was moved from the transform to the (previously unconditional) hook env set line. It didn't cause problems, because every repository had a project.
In time, we introduced repositories for personal snippets, where this is no longer true - and they broke. So we transformed the check to read if container
in 36ea5135, because we weren't sure if it was necessary or not, and we were in a hurry.
Now that I've dug into the history of this change, I'm confident we can make this call unconditional, so this MR does that. There are no project-dependent lines within parse_env
or set
. There are no tests that depend on the removed behaviour, because every possible instance where if container
returns nil would be a bug.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team