-
Notifications
You must be signed in to change notification settings - Fork 274
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
Added GERRIT_EVENT_FILE_BASED environment variable #358
base: master
Are you sure you want to change the base?
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. |
@@ -988,6 +989,10 @@ public boolean isInteresting(GerritTriggeredEvent event) { | |||
changeBasedEvent.getFiles( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |