Add branch prefix [RHELDST-36928]#139
Conversation
ubiconfig/_impl/loaders/gitlab.py
Outdated
| raise ValueError( | ||
| f"Branch prefix {prefix} is not matching with cdn-definition prefix {self._branch_prefix}." | ||
| ) |
There was a problem hiding this comment.
I haven't had a chance to review the 3 PRs in detail with full context, but I'm just jumping in to point out this error raising might be problematic (before I forget), given the previous filtering done in _pre_load. We wanted to avoid crashing the ubi sync jobs and warn + skip in the first place (see https://issues.redhat.com/browse/RHELDST-29955 and https://issues.redhat.com/browse/RHELDST-29966, and related PR: https://github.com/release-engineering/ubi-config/pull/82/changes).
Just bringing this to @rbikar's attention, we have chatted a bit about it, but I want to make sure I'm not missing the bigger picture here
There was a problem hiding this comment.
thanks for pointing that out.
@necipkavrukoglu
In real code we use typically load_all() - where the required filtering is already done. So this will become a dead code.
And also if one calls only load(), it should also filtered correctly because of pre_load() called during instantiation, so most likely this exception will never be raised.
Maybe you can simulate it in unit test, if there's such edge case.
d7d609a to
1b48fe9
Compare
1b48fe9 to
395994a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #139 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 365 371 +6
=========================================
+ Hits 365 371 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Same thing applies here, just like in release-engineering/ubi-manifest#322, always make sure to run all test environments in tox |
|
pylint seems to complain on some added code, can you have a look? https://github.com/release-engineering/ubi-config/actions/runs/22175017818/job/64165115081?pr=139 |
395994a to
28cdb8c
Compare
Right, missed one line linting, fixed
There is another merge request for ubi-config which needs to be merged first in order to not have failures related with it. |
Added comparison of CDN Definition prefix and Git branch name prefix. Skips in pre load and fails in load if they dont not match.
28cdb8c to
454927c
Compare
Currently it's easy to break UBI tooling when branch is created with non-standard naming.
In order to avoid this, branch_prefix configuration is added as optional parameter.
it is configured in CDN Definitions.
If prefixes do not match, pre load function skips these branches, load function fails.