-
Notifications
You must be signed in to change notification settings - Fork 16
Update release automation to support Privacy Pro section in release notes #2710
Conversation
…empty or placeholder is provided
release_notes="$(<release_notes.txt)" | ||
if [[ ${#release_notes} == 0 || "$release_notes" == "<-- Add release notes here -->" ]]; then | ||
echo "::error::Release notes are empty. Please add release notes to the Asana task and restart the workflow." | ||
| ./scripts/extract_release_notes.sh -r > raw_release_notes.txt |
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.
For validating release notes we don't need formatting, so extract raw release notes here.
echo "::error::Release notes are empty. Please add release notes to the Asana task and restart the workflow." | ||
| ./scripts/extract_release_notes.sh -r > raw_release_notes.txt | ||
raw_release_notes="$(<raw_release_notes.txt)" | ||
if [[ ${#raw_release_notes} == 0 || "$raw_release_notes" == *"<-- Add release notes here -->"* ]]; then |
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.
Small improvement to validation – we're now looking for the occurrence of the placeholder text within the release notes, not for the exact match.
@@ -172,6 +172,7 @@ jobs: | |||
uses: ./.github/workflows/tag_release.yml | |||
with: | |||
asana-task-url: ${{ needs.create_release_branch.outputs.asana_task_url }} | |||
base-branch: ${{ github.ref_name }} |
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.
Required for testing automation (it was accidentally removed in the original automation PR) but harmless for actual release runs, because this workflow asserts earlier that it's run from main
.
run: brew install bats-core | ||
|
||
- name: Run Bats tests | ||
run: bats --formatter junit scripts/tests/* > bats-tests.xml |
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.
😎
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.
Nice 👍
| jq -r .data.notes > release_task_content.txt | ||
raw_release_notes="$(./scripts/extract_release_notes.sh -r < release_task_content.txt)" | ||
if [[ ${#raw_release_notes} == 0 || "$raw_release_notes" == *"<-- Add release notes here -->"* ]]; then | ||
echo "::error::Release notes are empty or contain a placeholder. Please add release notes to the Asana task and restart the workflow." |
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.
Similar changes as in bump_internal_release.yml
exit 1 | ||
fi | ||
echo "RELEASE_NOTES_FILE=release_notes.txt" >> $GITHUB_ENV | ||
./scripts/extract_release_notes.sh < release_task_content.txt > release_notes.html |
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.
extract_release_notes.sh was called above to extract raw release notes for validation, and now we need to run it again to get HTML output for the appcast.
let releaseNotesPath = arguments.parameters["--release-notes"] | ||
let releaseNotesHTMLPath = arguments.parameters["--release-notes-html"] | ||
guard releaseNotesPath != nil || releaseNotesHTMLPath != nil else { |
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.
Require either of the plain text or html release notes. If both are provided, plain text takes precedence 🎲 but it's not expected anyway.
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.
Sounds good to me, this approach makes sense.
@@ -605,6 +626,27 @@ final class AppcastDownloader { | |||
|
|||
// MARK: - Handling of Release Notes | |||
|
|||
func handleReleaseNotesHTML(path: String, updatesDirectoryURL: URL, dmgURL: URL) { |
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.
Super simple handling: take the HTML input file and copy it to the expected destination. No processing in between.
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 script has become complex, but on the positive side, it also got unit tests 💪
Try it yourself:
$ brew install bats-core
$ bats scripts/tests/extract_release_notes/extract_release_notes.bats
@@ -48,7 +48,7 @@ fetch_current_release_notes() { | |||
curl -fLSs "${asana_api_url}/tasks/${release_task_id}?opt_fields=notes" \ | |||
-H "Authorization: Bearer ${ASANA_ACCESS_TOKEN}" \ | |||
| jq -r .data.notes \ | |||
| "${cwd}"/extract_release_notes.sh | |||
| "${cwd}"/extract_release_notes.sh -a |
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.
-a
stands for Asana rich text output. Then the release notes processed this way are ready to be added verbatim to the Asana release task description (so we're removing construct_release_notes
function)
…utdown # By Dax the Duck (9) and others # Via GitHub (6) and others * main: (47 commits) Update BSK to 141.1.1 (#2713) macOS: VPN Metadata Improvements (#2704) duck page suggestions (#2666) macOS: Add pixels to track VPN wake and stop attempts (#2694) Trusted url indicator (#2665) remove Tab.TabContent.url (#2647) Bump version to 1.85.0 (176) Update release automation to support Privacy Pro section in release notes (#2710) Fix for VPN stop issues. (#2689) Hard-codes the VPN waitlist flags to ON (#2709) Add subscription status to the macOS metadata (#2680) Bump version to 1.85.0 (175) Call finish in the correct place (#2702) Fix layout issue on DBP (#2700) Update autoconsent to v10.6.1 (#2618) Make Clear All History shortcut available without entering Main Menu (#2682) Fix DataBrokerProtectionProcessor.swift lint Fix SwiftLint Add parameter allowed encoding to error descriptions (#2691) Remove debug flags ... # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Task/Issue URL: https://app.asana.com/0/1177771139624306/1207157777571909/f
CC: @loremattei
Description:
This change makes it possible to display a separate section in release notes, dedicated to Privacy Pro:
release notes for the Asana release task.
PR checks workflow is updated with a job dedicated to running shell scripts unit tests.
Steps to test this PR:
release/0.81.0
branch locally.This requires you to have an Asana access token defined in
ASANA_ACCESS_TOKEN
environment variable:release/0.81.0
):./scripts/update_asana_for_release.sh internal 1207179392091595 1206716192269178 0.81.0
Example release notes screen, as generated by the updated appcastManager.swift:

Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation