From c3e0310b277b5e326e2318a793ac36f31476f1eb Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Wed, 16 Oct 2024 20:12:12 +0100 Subject: [PATCH 1/6] Release debugging --- .github/workflows/build-pr.yml | 2 +- .github/workflows/build.yml | 36 +++++++++++++++++++++------------- .github/workflows/tests.yml | 6 +++--- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index dc17c84b3f..8c087118f4 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -9,7 +9,7 @@ permissions: write-all jobs: build: if: github.event.action != 'closed' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e57852184f..6c965ce808 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,8 @@ name: Release on: + pull_request: + types: [opened, synchronize, closed, ready_for_review] workflow_dispatch: inputs: version: @@ -21,9 +23,10 @@ jobs: - name: Fetch files and checkout run: | - git fetch --all - git checkout releases - git checkout main . + git fetch origin + git checkout -b main origin/main + git checkout -b releases origin/releases + git checkout main -- . - name: Build release run: | @@ -44,15 +47,20 @@ jobs: - name: Collect commit ranges run: | - bash ./scripts/changelog.sh > ${{ github.workspace }}-CHANGELOG.txt + bash ./scripts/changelog.sh > ${{ github.workspace }}/CHANGELOG.txt - - name: Create Release - uses: softprops/action-gh-release@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - body_path: ${{ github.workspace }}-CHANGELOG.txt - draft: false - prerelease: false - tag_name: ${{ github.event.inputs.version }} - target_commitish: "releases" + - name: Debug changelog file + run: | + ls -la ${{ github.workspace }}/CHANGELOG.txt + cat ${{ github.workspace }}/CHANGELOG.txt + + #- name: Create Release + # uses: softprops/action-gh-release@v2 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # body_path: ${{ github.workspace }}/CHANGELOG.txt + # draft: false + # prerelease: false + # tag_name: ${{ github.event.inputs.version }} + # target_commitish: "releases" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 61fbe263ff..723c9b2b15 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-20.04, windows-latest ] + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v2 - name: Use Node.js 20 @@ -37,7 +37,7 @@ jobs: - name: "Clean tree" run: "npm run test-clean-tree" integration: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v2 @@ -76,7 +76,7 @@ jobs: run: npm run docs deploy-docs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: integration if: ${{ github.ref == 'refs/heads/main' }} environment: From 660b073ed1cb3adb1a6a5d4f927603bf7d5fe5e6 Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Wed, 16 Oct 2024 22:29:28 +0100 Subject: [PATCH 2/6] Make test release --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c965ce808..c8ac687188 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,13 +54,13 @@ jobs: ls -la ${{ github.workspace }}/CHANGELOG.txt cat ${{ github.workspace }}/CHANGELOG.txt - #- name: Create Release - # uses: softprops/action-gh-release@v2 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # body_path: ${{ github.workspace }}/CHANGELOG.txt - # draft: false - # prerelease: false - # tag_name: ${{ github.event.inputs.version }} - # target_commitish: "releases" + - name: Create Release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + body_path: ${{ github.workspace }}/CHANGELOG.txt + draft: true + prerelease: false + tag_name: "6.22.0" + target_commitish: "releases" From a7c1e19733f66c7a9061496c7642f1e04e60e464 Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Wed, 16 Oct 2024 22:33:28 +0100 Subject: [PATCH 3/6] Add version back in and clean up --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8ac687188..d066942efe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,6 @@ name: Release on: - pull_request: - types: [opened, synchronize, closed, ready_for_review] workflow_dispatch: inputs: version: @@ -60,7 +58,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: body_path: ${{ github.workspace }}/CHANGELOG.txt - draft: true + draft: false prerelease: false - tag_name: "6.22.0" + tag_name: ${{ github.event.inputs.version }} target_commitish: "releases" From 20863718b98331881459cc41f973194eca7b2709 Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Thu, 17 Oct 2024 09:33:00 +0100 Subject: [PATCH 4/6] Fix build paths --- injected/scripts/entry-points.js | 6 ++--- injected/src/types/webcompat-settings.d.ts | 28 +--------------------- injected/unit-test/verify-artifacts.js | 6 ++--- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/injected/scripts/entry-points.js b/injected/scripts/entry-points.js index eedb98f9a3..98cda060cc 100644 --- a/injected/scripts/entry-points.js +++ b/injected/scripts/entry-points.js @@ -18,7 +18,7 @@ const contentScopeName = 'contentScopeFeatures' const builds = { firefox: { input: 'entry-points/mozilla.js', - output: ['../build/firefox/entry-points.js'] + output: ['../build/firefox/injected.js'] }, apple: { input: 'entry-points/apple.js', @@ -47,11 +47,11 @@ const builds = { }, 'chrome-mv3': { input: 'entry-points/chrome-mv3.js', - output: ['../build/chrome-mv3/entry-points.js'] + output: ['../build/chrome-mv3/injected.js'] }, chrome: { input: 'entry-points/chrome.js', - output: ['../build/chrome/entry-points.js'] + output: ['../build/chrome/injected.js'] } } diff --git a/injected/src/types/webcompat-settings.d.ts b/injected/src/types/webcompat-settings.d.ts index bf84e22826..99b5a33757 100644 --- a/injected/src/types/webcompat-settings.d.ts +++ b/injected/src/types/webcompat-settings.d.ts @@ -29,33 +29,7 @@ export interface WebCompatSettings { undefined: string[]; }; }; - modifyLocalStorage?: { - state: State; - changes: { - key: string; - action: string; - }[]; - }; - notification?: { - state: State; - }; - permissions?: { - state: State; - supportedPermissions: {}; - }; - mediaSession?: State; - presentation?: State; - webShare?: State; - viewportWidth?: - | State - | { - state: State; - forcedDesktopValue?: string; - forcedMobileValue?: string; - }; - screenLock?: State; domains?: Domains; - plainTextViewPort?: State; } export interface Domain { /** @@ -79,5 +53,5 @@ export interface PatchSetting { /** * The value to replace at the specified path */ - value: string | unknown[] | {} | number; + value: string; } diff --git a/injected/unit-test/verify-artifacts.js b/injected/unit-test/verify-artifacts.js index 3239c4f378..ae9f6e7d02 100644 --- a/injected/unit-test/verify-artifacts.js +++ b/injected/unit-test/verify-artifacts.js @@ -23,14 +23,14 @@ const checks = { ] }, chrome: { - file: join(BUILD, 'chrome/entry-points.js'), + file: join(BUILD, 'chrome/inject.js'), tests: [ { kind: 'maxFileSize', value: CSS_OUTPUT_SIZE_CHROME }, { kind: 'containsString', text: '$TRACKER_LOOKUP$', includes: true } ] }, 'chrome-mv3': { - file: join(BUILD, 'chrome-mv3/entry-points.js'), + file: join(BUILD, 'chrome-mv3/inject.js'), tests: [ { kind: 'maxFileSize', value: CSS_OUTPUT_SIZE }, { kind: 'containsString', text: 'cloneInto(', includes: false }, @@ -38,7 +38,7 @@ const checks = { ] }, firefox: { - file: join(BUILD, 'firefox/entry-points.js'), + file: join(BUILD, 'firefox/inject.js'), tests: [ { kind: 'maxFileSize', value: CSS_OUTPUT_SIZE }, { kind: 'containsString', text: 'cloneInto(', includes: true }, From 8e61aa6876f08f37950b407ee95eb3ccb81cdd84 Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Thu, 17 Oct 2024 09:35:14 +0100 Subject: [PATCH 5/6] Update types back --- injected/src/types/webcompat-settings.d.ts | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/injected/src/types/webcompat-settings.d.ts b/injected/src/types/webcompat-settings.d.ts index 99b5a33757..bf84e22826 100644 --- a/injected/src/types/webcompat-settings.d.ts +++ b/injected/src/types/webcompat-settings.d.ts @@ -29,7 +29,33 @@ export interface WebCompatSettings { undefined: string[]; }; }; + modifyLocalStorage?: { + state: State; + changes: { + key: string; + action: string; + }[]; + }; + notification?: { + state: State; + }; + permissions?: { + state: State; + supportedPermissions: {}; + }; + mediaSession?: State; + presentation?: State; + webShare?: State; + viewportWidth?: + | State + | { + state: State; + forcedDesktopValue?: string; + forcedMobileValue?: string; + }; + screenLock?: State; domains?: Domains; + plainTextViewPort?: State; } export interface Domain { /** @@ -53,5 +79,5 @@ export interface PatchSetting { /** * The value to replace at the specified path */ - value: string; + value: string | unknown[] | {} | number; } From ae736f32dfc6530608e1279166679842ac2953ab Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Thu, 17 Oct 2024 09:37:44 +0100 Subject: [PATCH 6/6] Rename out file --- injected/scripts/entry-points.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/injected/scripts/entry-points.js b/injected/scripts/entry-points.js index 98cda060cc..aeb1b17c5c 100644 --- a/injected/scripts/entry-points.js +++ b/injected/scripts/entry-points.js @@ -18,7 +18,7 @@ const contentScopeName = 'contentScopeFeatures' const builds = { firefox: { input: 'entry-points/mozilla.js', - output: ['../build/firefox/injected.js'] + output: ['../build/firefox/inject.js'] }, apple: { input: 'entry-points/apple.js', @@ -47,11 +47,11 @@ const builds = { }, 'chrome-mv3': { input: 'entry-points/chrome-mv3.js', - output: ['../build/chrome-mv3/injected.js'] + output: ['../build/chrome-mv3/inject.js'] }, chrome: { input: 'entry-points/chrome.js', - output: ['../build/chrome/injected.js'] + output: ['../build/chrome/inject.js'] } }