[ 
https://issues.apache.org/jira/browse/BEAM-13951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17492311#comment-17492311
 ] 

Brian Hulette edited comment on BEAM-13951 at 2/18/22, 2:51 AM:
----------------------------------------------------------------

As a workaround for now I've retrieved a list of trigger phrases for all 
postcommits using the Jenkins API:

{code:bash}
#!/bin/bash

for url in $(curl https://ci-beam.apache.org/api/json | jq '.jobs[] | .url' 
-r); do
  curl --user bhulette:$JENKINS_TOKEN $url/config.xml > /tmp/config.xml

  if [ "$(xmllint --xpath 'string(//disabled)' /tmp/config.xml)" = "true" ]; 
then
    echo "SKIPPING $url - disabled"
  else
    echo "ADDING $url"
    xmllint --xpath 
'string(//triggers/org.jenkinsci.plugins.ghprb.GhprbTrigger/triggerPhrase)' 
/tmp/config.xml >> /tmp/result
  fi

  rm /tmp/config.xml
done
{code}
Then found relevant phrases:

{code}
cat all_run_commands| sort | uniq | grep -i -E 
'postcommit|validatess|vr|example|test|gradle build' | grep -v -i -E 'load|perf'
{code}

Then jammed the result into mass_comment.py. Note that some phrases are for 
jobs that should have been disabled (e.g. there's no continuously running 
variant, but the _PR variant is still there).

TODO:
- Send a PR to update mass_comment.py
- Consider replacing mass_comment.py with a solution that just triggers 
relevant jobs directly through the Jenkins API


was (Author: bhulette):
As a workaround for now I've retrieved a list of trigger phrases for all 
postcommits using the Jenkins API:

{code:bash}
#!/bin/bash

for url in $(curl https://ci-beam.apache.org/api/json | jq '.jobs[] | .url' 
-r); do
  curl --user bhulette:$JENKINS_TOKEN $url/config.xml > /tmp/config.xml

  if [ "$(xmllint --xpath 'string(//disabled)' /tmp/config.xml)" = "true" ]; 
then
    echo "SKIPPING $url - disabled"
  else
    echo "ADDING $url"
    xmllint --xpath 
'string(//triggers/org.jenkinsci.plugins.ghprb.GhprbTrigger/triggerPhrase)' 
/tmp/config.xml >> /tmp/result
  fi

  rm /tmp/config.xml
done
{code}

Then jammed the relevant phrases into mass_comment.py.

TODO:
- Send a PR to update mass_comment.py
- Consider replacing mass_comment.py with a solution that just triggers 
relevant jobs directly through the Jenkins API

> mass_comment.py has outdated list of Run strings
> ------------------------------------------------
>
>                 Key: BEAM-13951
>                 URL: https://issues.apache.org/jira/browse/BEAM-13951
>             Project: Beam
>          Issue Type: Bug
>          Components: release
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: P2
>
> mass_comment.py is intended to facilitate running all PostCommits on a 
> release branch, but the list of "All PostCommits" is never updated, so many 
> PostCommits have not been executed as part of release validation.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to