Added GERRIT_EVENT_FILE_BASED environment variable - #358
Conversation
venkrao
commented
Mar 19, 2018
GERRIT_EVENT_FILE_BASED is set to True if the
build is triggered due to a file-based event.
Otherwise, False.
|
I can't understand the reason for the test failure. Any help is appreciated. https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fgerrit-trigger-plugin/detail/PR-358/1/pipeline are the logs. |
| new GerritQueryHandler(getServerConfig(event))))) { | ||
| logger.trace("According to {} the event is interesting.", p); | ||
| if (triggerParamRuntime == null) { | ||
| triggerParamRuntime = new GerritTriggerRuntimeParam(); |
There was a problem hiding this comment.
This is bad as the GerritTrigger object is one instance per job so adding a field to it means adding a field to the job not the build.
There was a problem hiding this comment.
To be honest, I can't think of another way of doing it. Please give me some clues to which file is the right one for this purpose.
As far as why I thought this was the only option: This is the only file that knows about list of files involved in a given Gerrit change(changeBasedEvent.getFiles), thus, able to check if the affected-files in a gerrit change match the filtered files of file-based-trigger configuration.
There was a problem hiding this comment.
You would need to carry the information over from somewhere around here to the build. data in builds are stored via actions, int this case the simplest would be to put the information into the GerritCause object that is added to the build when scheduled.
Also, here I don't know if you can be sure the event was interesting because of the file, but maybe :)
|
EVERE: Notify-error: |
|
What is FileBasedEvent? |