-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define a nightly macro with a nightly githash as input #8433
Conversation
Now the tricky bit is how in our generic PR jobs to determine and then copy over the
Given this data is known to the configuration within package manifest, I am thinking I may have to build more knowledge into Obal via either:
The downsides of this being it teaches Obal more things that are specific to the nightly workflow, the upside being it keeps CI and local use of commands congruent based on configuration. The CI approach I can think of would be to keep a hash of package to project mappings and if a package to be built is in the hash, then it copies over and reads the commit hash just like the nightly jobs do today and aligns those workflows. We just have to keep that hash (not that it changes much) within CI. |
I was thinking along the same lines with #8412: getting the actual commit hash is tricky. |
@@ -12,6 +12,9 @@ packages: | |||
vars: | |||
rpmlint_rc_file: "{{ inventory_dir }}/.rpmlintrc" | |||
build_package_use_koji_build: true | |||
macros: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes the macros
var always available and I am not 100% you had intended this? (if you did, cool, just wanted to explicitly point it out)
@@ -12,6 +12,9 @@ packages: | |||
vars: | |||
rpmlint_rc_file: "{{ inventory_dir }}/.rpmlintrc" | |||
build_package_use_koji_build: true | |||
macros: | |||
foremandist: "{{ foremandist }}" | |||
nightly: "{{ '.' + lookup('pipe', 'date +%Y%m%d%H%M%S') + 'git' + nightly_githash[:7] if nightly_githash is defined else omit }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to try it out to realize the else omit
actually wipes the whole thing when nightly_githash
is not set.
nightly: "{{ '.' + lookup('pipe', 'date +%Y%m%d%H%M%S') + 'git' + nightly_githash[:7] if nightly_githash is defined else omit }}" | |
nightly: "{{ ('.' + lookup('pipe', 'date +%Y%m%d%H%M%S') + 'git' + nightly_githash[:7]) if nightly_githash is defined else omit }}" |
IMHO this makes it more readable?
The more I look at it, the less I understand how today (It's obvious for the |
The source location is defined in the package_manifest, which then is passed to |
Well, it would have certainly helped, if I didn't look at the manifest in rpm/3.3 🙈 |
Requires theforeman/obal#320 to work, as this allows us to define and control the nightly macro here in the project itself and allow Obal to be more generic.
Currently we run
obal nightly
on actual nightly jobs butobal release
for packaging PRs, these have disjointed workflows andobal nightly
(https://github.com/theforeman/obal/blob/master/obal/data/playbooks/nightly/nightly.yaml) is trying to do a lot that is not required anymore; it was working around tito whereas with tito out of the picture we have more direct control and methods.This will allow us in our CI to simply set
-e nightly_githash=whateverweant
and it will get incorporated into the SRPM. Example: http://koji.katello.org/koji/taskinfo?taskID=530916