Add changelog check after a new release is created#321
Add changelog check after a new release is created#321isabelrios wants to merge 7 commits intomainfrom
Conversation
| environment { | ||
| PATH = "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:${env.PATH}" | ||
| GITHUB_TOKEN = credentials('github-token') | ||
| SLACK_WEBHOOK = credentials('slack-mobile-alerts-tooling-webhook') |
There was a problem hiding this comment.
I may add the sandbox webhook instead to not make noise in channels
There was a problem hiding this comment.
you can use slack-mobile-alerts-sandbox-webhook credentials
| } | ||
| steps { | ||
| script { | ||
| try { |
There was a problem hiding this comment.
Adding this so that if the new job fails, the current job will not be affected. The failure will be shown as a warning.
| @@ -0,0 +1,36 @@ | |||
| name: Changelog Analysis | |||
There was a problem hiding this comment.
Adding this github action to be able to manually debug and verify that we get the correct changelog
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install requests pyyaml |
There was a problem hiding this comment.
stage('Install Dependencies') {
steps {
dir('testrail') {
sh '''
set -e
python3 -m venv .venv
.venv/bin/pip install --no-cache-dir -r requirements.txt
'''
}
}
} Can we use venv?
There was a problem hiding this comment.
here in the github action or you mean in the jenkinsfile @mdotb-moz ?
There was a problem hiding this comment.
sorry in the jenkinsfile
| on: | ||
| push: | ||
| branches: | ||
| - irios-new-jenkins-file-verify-release-tags |
There was a problem hiding this comment.
Is this scoped just for testing on this branch currently?
There was a problem hiding this comment.
Yes, this is for testing purposes, we would not need the github action since the Jenkins file with the script will be triggered as part of the Create milestone job. Once there is a new version detected, we run the changelog to know what has been affected by the new release
|
|
||
|
|
||
| def get_changed_files(owner: str, repo: str, base: str, head: str) -> List[str]: | ||
| url = f"https://api.github.com/repos/{owner}/{repo}/compare/{base}...{head}" |
There was a problem hiding this comment.
Should note here that this returns a maximum of 250 commits that will have to paginated.
When calling this endpoint without any paging parameter (per_page or page), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.
For large releases, files beyond that limit are silently dropped here
There was a problem hiding this comment.
oh that is a good catch thank you. I will add that
| testrail_project_id, milestone_name, milestone_description | ||
| ) | ||
|
|
||
| with open("milestone_id.txt", "w") as f: |
There was a problem hiding this comment.
This is written to root but in the Jenkins file it's read from testrail, I would write to a similar testrail dir
| passwordVariable: 'TESTRAIL_PASSWORD')]) { | ||
| sh ''' | ||
| python3 run_release_selection.py \ | ||
| --head_tag ${RELEASE_TAG} \ |
There was a problem hiding this comment.
I only see a base_tag as currently accepted in the script
There was a problem hiding this comment.
I am missing some changes here.. --head_tag would be given by RELEASE_TAG which is shared from a previous script.
There was a problem hiding this comment.
create-milestone triggers create-smart-test-runs and passes RELEASE_TAG as a parameter, so the Jenkinsfile always calls the script with --head_tag
0cfd35c to
3911547
Compare
The end goal is to automatically create targeted TestRail test runs based on what code changed between two release versions, added to the same milestone created by the existing iOS release automation.
In order to do this iteratively, let's just add the new jenkins file that will check the change log between current and previous release, nothing else for now. It will send a notification like: