-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
CI: add git commit hash to file description of uploaded SITL log #12047
CI: add git commit hash to file description of uploaded SITL log #12047
Conversation
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.
Doesn't seem to be working?
@dagar do we have the git plugin installed in jenkins? I think the But, if this is a lot of effort I'll look for another way to track the git commits. |
@JohannesBrand We have git plugin 3.10.0 installed and this env var was made available in 3.2.3 according to the issue in Jenkins Jira. That said, this doesn't work the way you would expect it to (Jenkins is a tricky beast to wrap your head around). The way this works is: as one stage, a slave (ec2 machine) fetches the firmware from git, builds it and packages it (it gets archived and pushed over to the Jenkins master machine). Then, different (most likely) slaves grab that package and run the simulation. Because there is no checkout step in the SITL stages, there are no scm env variables available and the SITL slaves have no knowledge of what happened with git. So, there are a couple different ways to tackle this if we want it. I have a good handle on possibilities if help is needed. |
@lamping7 cool, thanks. I thought I'd just use some simple command line scripting but this sounds more complicated. what are the options you're thinking about? |
Because this pipeline is scripted, you could define a global groovy variable up top, set the variable from the agent that does the checkout operation in the build stage, then the subsequent stages should have access to it. I'm not sure if that's clear. If not, let me know and I can PR this. In a declarative pipeline I think you'd need to perform a checkout step in each stage, which is mostly a waste of time, but would give you the info you need. As a side note, the ASan and coverage run the same tests, but with different purposes. I'm not sure if we need this for those. Additionally, I'm not sure why we push those runs to flight review. Essentially we're pushing the same test 3 times. But, changing this is out of scope here and more of a question for @dagar. |
This pull request adds the hash of the current git commit to the description field of the log file uploaded to PX4 flight review during CI.
Why?
better traceability of PX4 SITL logs uploaded to flight review.
This pull request makes use of the
GIT_COMMIT
environment variable described in the Jenkins wiki. According to the wikiall the GIT_* variables require the git plugin
. Hence, this pull request might not work, if the git plugin is not available.