[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser-build][main] 2 commits: Bug 41042: Add options to include updates in the changelog scripts.



Title: GitLab

richard pushed to branch main at The Tor Project / Applications / tor-browser-build

Commits:

  • 2854ab80
    by Pier Angelo Vendrame at 2023-12-14T13:48:08+00:00
    Bug 41042: Add options to include updates in the changelog scripts.
    
    Pass the new version of components as arguments to avoid having to
    change the changelog output after it has been generated by the script.
    
  • ae04fe1d
    by Pier Angelo Vendrame at 2023-12-14T13:48:08+00:00
    Update the GitLab templates.
    
    Update the release preparations for the new changelog script arguments
    and also to fix some steps that were not correct anymore.
    

7 changed files:

Changes:

  • .gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md
    ... ... @@ -62,26 +62,20 @@
    62 62
           - [ ] ***(Optional)*** If new version available, update `mullvad-extension` section of `input_files` in `projects/browser/config`
    
    63 63
             - [ ] `URL`
    
    64 64
             - [ ] `sha256sum`
    
    65
    -  - [ ] Update `ChangeLog-MB.txt`
    
    66
    -    - [ ] Ensure ChangeLog-MB.txt is sync'd between alpha and stable branches
    
    67
    -    - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
    
    68
    -    - [ ] Run `tools/fetch-changelogs.py $(TOR_BROWSER_VERSION)` or `tools/fetch-changelogs.py '#$(ISSUE_NUMBER)'`
    
    69
    -      - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
    
    70
    -      - The first time you run this script you will need to generate an access token; the script will guide you
    
    71
    -    - [ ] Copy the output of the script to the beginning of `ChangeLog-MB.txt` and update its output
    
    72
    -      - [ ] Version
    
    73
    -      - [ ] Browser Name
    
    74
    -      - [ ] Release Date
    
    75
    -    - [ ] Under `All Platforms` include any version updates for:
    
    76
    -      - NoScript
    
    77
    -      - uBlock-origin
    
    78
    -      - Mullvad Browser Extension
    
    79
    -      - Firefox
    
    80
    -  - [ ] Open MR with above changes
    
    81
    -  - [ ] Build the MR after initial review on at least two of:
    
    82
    -    - [ ] Tor Project build machine
    
    83
    -    - [ ] Mullvad build machine
    
    84
    -    - [ ] Local developer machine
    
    65
    +    - [ ] Update `ChangeLog-MB.txt`
    
    66
    +      - [ ] Ensure `ChangeLog-MB.txt` is sync'd between alpha and stable branches
    
    67
    +      - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
    
    68
    +      - [ ] Run `tools/fetch-changelogs.py $(ISSUE_NUMBER) --date $date $updateArgs`
    
    69
    +        - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
    
    70
    +        - The first time you run this script you will need to generate an access token; the script will guide you
    
    71
    +        - `$updateArgs` should be these arguments, depending on what you actually updated:
    
    72
    +          - [ ] `--firefox`
    
    73
    +          - [ ] `--no-script`
    
    74
    +          - [ ] `--ublock`
    
    75
    +          - E.g., `tools/fetch-changelogs.py 41029 --date 'December 19 2023' --firefox 115.6.0esr --no-script 11.4.29 --ublock 1.54.0`
    
    76
    +        - `--date $date` is optional, if omitted it will be the date on which you run the command
    
    77
    +      - [ ] Copy the output of the script to the beginning of `ChangeLog-MB.txt` and adjust its output
    
    78
    +  - [ ] Open MR with above changes, using the template for release preparations
    
    85 79
       - [ ] Ensure builders have matching builds
    
    86 80
       - [ ] Merge
    
    87 81
       - [ ] Sign+Tag
    
    ... ... @@ -92,32 +86,11 @@
    92 86
           - pierov
    
    93 87
           - richard
    
    94 88
         - [ ] Run: `make mullvadbrowser-signtag-alpha`
    
    95
    -    - [ ] Push tag to `origin`
    
    96
    -
    
    97
    -</details>
    
    98
    -
    
    99
    -<details>
    
    100
    -  <summary>QA</summary>
    
    101
    -
    
    102
    -  ### send the build
    
    103
    -  - [ ] Email Mullvad QA: support@xxxxxxxxxxx, rui@xxxxxxxxxxx
    
    104
    -    <details>
    
    105
    -      <summary>email template</summary>
    
    106
    -
    
    107
    -        Subject:
    
    108
    -        New build: Mullvad Browser $(MULLVAD_BROWSER_VERION) (unsigned)
    
    109
    -
    
    110
    -        Body:
    
    111
    -        unsigned builds: https://tb-build-05.torproject.org/~$(BUILDER)/builds/mullvadbrowser/alpha/unsigned/$(MB_BUILD_TAG)
    
    112
    -
    
    113
    -        changelog:
    
    114
    -        ...
    
    115
    -
    
    116
    -    </details>
    
    117
    -
    
    118
    -    - ***(Optional)*** Add additional information:
    
    119
    -      - [ ] Note any new functionality which needs testing
    
    120
    -      - [ ] Link to any known issues
    
    89
    +  - [ ] Push tag to `upstream`
    
    90
    +  - [ ] Build the tag on at least two of:
    
    91
    +    - [ ] Tor Project build machine
    
    92
    +    - [ ] Mullvad build machine
    
    93
    +    - [ ] Local developer machine
    
    121 94
     
    
    122 95
     </details>
    
    123 96
     
    

  • .gitlab/issue_templates/Release Prep - Mullvad Browser Stable.md
    ... ... @@ -60,7 +60,20 @@ Mullvad Browser Stable lives in the various `maint-$(MULLVAD_BROWSER_MAJOR).$(MU
    60 60
         - [ ] ***(Optional)*** If new version available, update `mullvad-extension` section of `input_files` in `projects/browser/config`
    
    61 61
           - [ ] `URL`
    
    62 62
           - [ ] `sha256sum`
    
    63
    -- [ ] Open MR with above changes
    
    63
    +- [ ] Update `ChangeLog-MB.txt`
    
    64
    +  - [ ] Ensure `ChangeLog-MB.txt` is sync'd between alpha and stable branches
    
    65
    +  - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
    
    66
    +  - [ ] Run `tools/fetch-changelogs.py $(ISSUE_NUMBER) --date $date $updateArgs`
    
    67
    +    - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
    
    68
    +    - The first time you run this script you will need to generate an access token; the script will guide you
    
    69
    +    - `$updateArgs` should be these arguments, depending on what you actually updated:
    
    70
    +      - [ ] `--firefox`
    
    71
    +      - [ ] `--no-script`
    
    72
    +      - [ ] `--ublock`
    
    73
    +      - E.g., `tools/fetch-changelogs.py 41029 --date 'December 19 2023' --firefox 115.6.0esr --no-script 11.4.29 --ublock 1.54.0`
    
    74
    +    - `--date $date` is optional, if omitted it will be the date on which you run the command
    
    75
    +  - [ ] Copy the output of the script to the beginning of `ChangeLog-MB.txt` and adjust its output
    
    76
    +- [ ] Open MR with above changes, using the template for release preparations
    
    64 77
     - [ ] Merge
    
    65 78
     - [ ] Sign/Tag commit: `make mullvadbrowser-signtag-release`
    
    66 79
     - [ ] Push tag to `origin`
    
    ... ... @@ -70,32 +83,6 @@ Mullvad Browser Stable lives in the various `maint-$(MULLVAD_BROWSER_MAJOR).$(MU
    70 83
     
    
    71 84
     </details>
    
    72 85
     
    
    73
    -<details>
    
    74
    -  <summary>QA</summary>
    
    75
    -
    
    76
    -### send the build
    
    77
    -
    
    78
    -  - [ ] Email Mullvad QA: support@xxxxxxxxxxx, rui@xxxxxxxxxxx
    
    79
    -    <details>
    
    80
    -      <summary>email template</summary>
    
    81
    -
    
    82
    -        Subject:
    
    83
    -        New build: Mullvad Browser $(MULLVAD_BROWSER_VERION) (unsigned)
    
    84
    -
    
    85
    -        Body:
    
    86
    -        unsigned builds: https://tb-build-05.torproject.org/~$(BUILDER)/builds/mullvadbrowser/release/unsigned/$(MB_BUILD_TAG)
    
    87
    -
    
    88
    -        changelog:
    
    89
    -        ...
    
    90
    -
    
    91
    -    </details>
    
    92
    -
    
    93
    -    - ***(Optional)*** Add additional information:
    
    94
    -      - [ ] Note any new functionality which needs testing
    
    95
    -      - [ ] Link to any known issues
    
    96
    -
    
    97
    -</details>
    
    98
    -
    
    99 86
     <details>
    
    100 87
       <summary>Signing</summary>
    
    101 88
     
    
    ... ... @@ -192,4 +179,4 @@ Mullvad Browser Stable lives in the various `maint-$(MULLVAD_BROWSER_MAJOR).$(MU
    192 179
     
    
    193 180
     </details>
    
    194 181
     
    
    195
    -/label ~"Release Prep"
    182
    +/label ~"Release Prep" ~"Sponsor 131"

  • .gitlab/issue_templates/Release Prep - Tor Browser Alpha.md
    ... ... @@ -93,30 +93,22 @@
    93 93
               - [ ] Change the `version` to `$PIPELINEID`
    
    94 94
               - [ ] Update `sha256sum` in the `input_files` section
    
    95 95
       - [ ] Update `ChangeLog-TBB.txt`
    
    96
    -    - [ ] Ensure ChangeLog-TBB.txt is sync'd between alpha and stable branches
    
    96
    +    - [ ] Ensure `ChangeLog-TBB.txt` is sync'd between alpha and stable branches
    
    97 97
         - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
    
    98
    -    - [ ] Run `tools/fetch-changelogs.py $(TOR_BROWSER_VERSION)` or `tools/fetch-changelogs.py '#$(ISSUE_NUMBER)'`
    
    98
    +    - [ ] Run `tools/fetch-changelogs.py $(ISSUE_NUMBER) --date $date $updateArgs`
    
    99 99
           - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
    
    100 100
           - The first time you run this script you will need to generate an access token; the script will guide you
    
    101
    -    - [ ] Copy the output of the script to the beginning of `ChangeLog-TBB.txt` and update its output
    
    102
    -      - [ ] Version
    
    103
    -      - [ ] Browser Name
    
    104
    -      - [ ] Release Date
    
    105
    -    - [ ] Under `All Platforms` include any version updates for:
    
    106
    -      - NoScript
    
    107
    -      - tor
    
    108
    -      - OpenSSL
    
    109
    -      - lyrebird
    
    110
    -      - Snowflake
    
    111
    -    - [ ] Under `Windows + macOS + Linux` include any version updates for:
    
    112
    -      - Firefox
    
    113
    -    - [ ] Under `Android` include any version updates for:
    
    114
    -      - Geckoview
    
    115
    -    - [ ] Under `Windows + Android` include any version updates for:
    
    116
    -      - zlib
    
    117
    -    - [ ] Under `Build System/All Platforms` include any version updates for:
    
    118
    -      - Go
    
    119
    -  - [ ] Open MR with above changes
    
    101
    +      - `$updateArgs` should be these arguments, depending on what you actually updated:
    
    102
    +          - [ ] `--firefox` (be sure to include esr at the end if needed, which is usually the case)
    
    103
    +          - [ ] `--tor`
    
    104
    +          - [ ] `--no-script`
    
    105
    +          - [ ] `--openssl`
    
    106
    +          - [ ] `--zlib`
    
    107
    +          - [ ] `--go`
    
    108
    +          - E.g., `tools/fetch-changelogs.py 41028 --date 'December 19 2023' --firefox 115.6.0esr --tor 0.4.8.10 --no-script 11.4.29 --zlib 1.3 --go 1.21.5 --openssl 3.0.12`
    
    109
    +        - `--date $date` is optional, if omitted it will be the date on which you run the command
    
    110
    +      - [ ] Copy the output of the script to the beginning of `ChangeLog-TBB.txt` and adjust its output
    
    111
    +  - [ ] Open MR with above changes, using the template for release preparations
    
    120 112
       - [ ] Build the MR after initial review on at least two of:
    
    121 113
         - [ ] Tor Project build machine
    
    122 114
         - [ ] Mullvad build machine
    

  • .gitlab/issue_templates/Release Prep - Tor Browser Stable.md
    ... ... @@ -45,10 +45,11 @@ Tor Browser Stable lives in the various `maint-$(TOR_BROWSER_MAJOR).$(TOR_BROWSE
    45 45
         - [ ] ***(Optional)*** `var/firefox_platform_version` : update to latest `$(ESR_VERSION)` if rebased
    
    46 46
       - [ ] Update `projects/translation/config`:
    
    47 47
         - [ ] run `make list_translation_updates-release` to get updated hashes
    
    48
    -    - [ ] `steps/base-browser/git_hash` : update with `HEAD` commit of project's `base-browser` branch
    
    49
    -    - [ ] `steps/base-browser-fluent/git_hash` : update with `HEAD` commit of project's `basebrowser-newidentityftl` branch
    
    50
    -    - [ ] `steps/tor-browser/git_hash` : update with `HEAD` commit of project's `tor-browser` branch
    
    51
    -    - [ ] `steps/fenix/git_hash` : update with `HEAD` commit of project's `fenix-torbrowserstringsxml` branch
    
    48
    +    - [ ] Update `projects/translation/config`:
    
    49
    +      - [ ] run `make list_translation_updates-alpha` to get updated hashes
    
    50
    +      - [ ] `steps/base-browser/git_hash` : update with `HEAD` commit of project's `base-browser` branch
    
    51
    +      - [ ] `steps/tor-browser/git_hash` : update with `HEAD` commit of project's `tor-browser` branch
    
    52
    +      - [ ] `steps/fenix/git_hash` : update with `HEAD` commit of project's `fenix-torbrowserstringsxml` branch
    
    52 53
     - [ ] Update Android-specific build configs
    
    53 54
       - [ ] Update `projects/geckoview/config`
    
    54 55
         - [ ] `browser_build` : update to match `tor-browser` tag
    
    ... ... @@ -58,10 +59,9 @@ Tor Browser Stable lives in the various `maint-$(TOR_BROWSER_MAJOR).$(TOR_BROWSE
    58 59
       - [ ] ***(Optional)*** Update `projects/application-services/config`:
    
    59 60
         **NOTE** we don't currently have any of our own patches for this project
    
    60 61
         - [ ] `git_hash` : update to appropriate git commit associated with `$(ESR_VERSION)`
    
    61
    -  - [ ] ***(Optional)*** Update `projects/android-components/config`:
    
    62
    -    - [ ] `android_components_build` : update to match stable android-components tag
    
    63
    -  - [ ] ***(Optional)*** Update `projects/fenix/config`
    
    64
    -    - [ ] `fenix_build` : update to match fenix tag
    
    62
    +  - [ ] ***(Optional)*** Update `projects/firefox-android/config`:
    
    63
    +      - [ ] `fenix_version` : update to match alpha `firefox-android` build tag
    
    64
    +      - [ ] `browser_branch` : update to match alpha `firefox-android` build tag
    
    65 65
       - [ ] Update allowed_addons.json by running (from `tor-browser-build` root):
    
    66 66
         - `./tools/fetch_allowed_addons.py > projects/browser/allowed_addons.json`
    
    67 67
     - [ ] Update common build configs
    
    ... ... @@ -79,43 +79,39 @@ Tor Browser Stable lives in the various `maint-$(TOR_BROWSER_MAJOR).$(TOR_BROWSE
    79 79
       - [ ] Check for tor updates here : https://gitlab.torproject.org/tpo/core/tor/-/tags
    
    80 80
         - [ ] ***(Optional)*** Update `projects/tor/config` 
    
    81 81
           - [ ] `version` : update to latest non `-alpha` tag (ping dgoulet or ahf if unsure)
    
    82
    -  - [ ] Check for go updates here : https://golang.org/dl
    
    82
    +  - [ ] Check for go updates here : https://go.dev/dl
    
    83 83
         - **NOTE** : Tor Browser Stable uses the latest of the *previous* Stable major series go version (apart from the transition phase from Tor Browser Alpha to Stable, in which case Tor Browser Stable may use the latest major series go version)
    
    84 84
         - [ ] ***(Optional)*** Update `projects/go/config`
    
    85 85
           - [ ] `version` : update go version
    
    86 86
           - [ ] `input_files/sha256sum` for `go` : update sha256sum of archive (sha256 sums are displayed on the go download page)
    
    87
    -    - [ ] Check for manual updates by running (from `tor-browser-build` root): `./tools/fetch-manual.py`
    
    88
    -      - [ ] ***(Optional)*** If new version is available:
    
    89
    -        - [ ] Upload the downloaded `manual_$PIPELINEID.zip` file to `tb-build-02.torproject.org`
    
    90
    -        - [ ] Deploy to `tb-builder`'s `public_html` directory:
    
    91
    -          - `sudo -u tb-builder cp manual_$PIPELINEID.zip ~/../tb-builder/public_html/.`
    
    92
    -        - [ ] Update `projects/manual/config`:
    
    93
    -          - [ ] Change the `version` to `$PIPELINEID`
    
    94
    -          - [ ] Update `sha256sum` in the `input_files` section
    
    95
    -- [ ] Update `ChangeLog.txt`
    
    96
    -  - [ ] Ensure ChangeLog.txt is sync'd between alpha and stable branches
    
    87
    +  - [ ] Check for manual updates by running (from `tor-browser-build` root): `./tools/fetch-manual.py`
    
    88
    +    - [ ] ***(Optional)*** If new version is available:
    
    89
    +      - [ ] Upload the downloaded `manual_$PIPELINEID.zip` file to `tb-build-02.torproject.org`
    
    90
    +      - [ ] Deploy to `tb-builder`'s `public_html` directory:
    
    91
    +        - `sudo -u tb-builder cp manual_$PIPELINEID.zip ~/../tb-builder/public_html/.`
    
    92
    +      - [ ] Update `projects/manual/config`:
    
    93
    +        - [ ] Change the `version` to `$PIPELINEID`
    
    94
    +        - [ ] Update `sha256sum` in the `input_files` section
    
    95
    +- [ ] Update `ChangeLog-TBB.txt`
    
    96
    +  - [ ] Ensure `ChangeLog-TBB.txt` is sync'd between alpha and stable branches
    
    97 97
       - [ ] Check the linked issues: ask people to check if any are missing, remove the not fixed ones
    
    98
    -  - [ ] Run `tools/fetch-changelogs.py $(TOR_BROWSER_VERSION)` or `tools/fetch-changelogs.py '#$(ISSUE_NUMBER)'`
    
    98
    +  - [ ] Run `tools/fetch-changelogs.py $(ISSUE_NUMBER) --date $date $updateArgs`
    
    99 99
         - Make sure you have `requests` installed (e.g., `apt install python3-requests`)
    
    100 100
         - The first time you run this script you will need to generate an access token; the script will guide you
    
    101
    -  - [ ] Copy the output of the script to the beginning of `ChangeLog.txt` and adjust its output
    
    102
    -    - **NOTE** : If you used the issue number, you will need to write the Tor Browser version manually
    
    103
    -  - [ ] ***(Optional)*** Under `All Platforms` include any version updates for:
    
    104
    -    - [ ] Translations
    
    105
    -    - [ ] OpenSSL
    
    106
    -    - [ ] NoScript
    
    107
    -    - [ ] zlib
    
    108
    -    - [ ] tor daemon
    
    109
    -  - [ ] ***(Optional)*** Under `Windows + macOS + Linux` include updates for:
    
    110
    -    - [ ] Firefox
    
    111
    -  - [ ] ***(Optional)*** Under `Android`, include updates for:
    
    112
    -    - [ ] Geckoview
    
    113
    -  - [ ] ***(Optional)*** Under `Build System/All Platforms` include updates for:
    
    114
    -    - [ ] Go
    
    115
    -- [ ] Open MR with above changes
    
    101
    +    - `$updateArgs` should be these arguments, depending on what you actually updated:
    
    102
    +      - [ ] `--firefox` (be sure to include esr at the end if needed, which is usually the case)
    
    103
    +      - [ ] `--tor`
    
    104
    +      - [ ] `--no-script`
    
    105
    +      - [ ] `--openssl`
    
    106
    +      - [ ] `--zlib`
    
    107
    +      - [ ] `--go`
    
    108
    +      - E.g., `tools/fetch-changelogs.py 41028 --date 'December 19 2023' --firefox 115.6.0esr --tor 0.4.8.10 --no-script 11.4.29 --zlib 1.3 --go 1.21.5 --openssl 3.0.12`
    
    109
    +    - `--date $date` is optional, if omitted it will be the date on which you run the command
    
    110
    +  - [ ] Copy the output of the script to the beginning of `ChangeLog-TBB.txt` and adjust its output
    
    111
    +- [ ] Open MR with above changes, using the template for release preparations
    
    116 112
     - [ ] Merge
    
    117 113
     - [ ] Sign/Tag commit: `make torbrowser-signtag-release`
    
    118
    -- [ ] Push tag to `origin`
    
    114
    +- [ ] Push tag to `upstream`
    
    119 115
     - [ ] Begin build on `$(BUILD_SERVER)` (fix any issues in subsequent MRs)
    
    120 116
     - [ ] **TODO** Submit build-tag to Mullvad build infra
    
    121 117
     - [ ] Ensure builders have matching builds
    

  • .gitlab/merge_request_templates/default.md
    ... ... @@ -43,16 +43,16 @@
    43 43
       - **localization** : henry, pierov
    
    44 44
       - **macos** : clairehurst, dan
    
    45 45
       - **nightly builds** : boklm
    
    46
    -  - **rebases/release-prep** : dan, ma1, pierov, richard
    
    46
    +  - **rebases/release-prep** : boklm, dan, ma1, pierov, richard
    
    47 47
       - **security** : ma1
    
    48 48
       - **signing** : boklm, richard
    
    49 49
       - **updater** : pierov
    
    50 50
       - **misc/other** : pierov, richard
    
    51 51
     
    
    52
    -#### Change Description
    
    52
    +### Change Description
    
    53 53
     
    
    54 54
     <!-- Whatever context the reviewer needs to effectively review the patchset; if the patch includes UX updates be sure to include screenshots/video of how any new behaviour -->
    
    55 55
     
    
    56 56
     #### How Tested
    
    57 57
     
    
    58
    -<!-- Description of steps taken to verify the change -->
    \ No newline at end of file
    58
    +<!-- Description of steps taken to verify the change -->

  • .gitlab/merge_request_templates/relprep.md
    1
    +## Merge Info
    
    2
    +
    
    3
    +### Related Issues
    
    4
    +
    
    5
    +- tor-browser-build#xxxxx
    
    6
    +- tor-browser-build#xxxxx
    
    7
    +
    
    8
    +## Review
    
    9
    +
    
    10
    +### Request Reviewer
    
    11
    +
    
    12
    +- [ ] Request review from a release engineer: boklm, dan, ma1, pierov, richard
    
    13
    +
    
    14
    +### Change Description
    
    15
    +

  • tools/fetch-changelogs.py
    1 1
     #!/usr/bin/env python3
    
    2
    +import argparse
    
    2 3
     from datetime import datetime
    
    3 4
     import enum
    
    4 5
     from pathlib import Path
    
    ... ... @@ -23,6 +24,11 @@ project_order = {
    23 24
     }
    
    24 25
     
    
    25 26
     
    
    27
    +class EntryType(enum.IntFlag):
    
    28
    +    UPDATE = 0
    
    29
    +    ISSUE = 1
    
    30
    +
    
    31
    +
    
    26 32
     class Platform(enum.IntFlag):
    
    27 33
         WINDOWS = 8
    
    28 34
         MACOS = 4
    
    ... ... @@ -32,40 +38,12 @@ class Platform(enum.IntFlag):
    32 38
         ALL_PLATFORMS = 8 | 4 | 2 | 1
    
    33 39
     
    
    34 40
     
    
    35
    -class Issue:
    
    36
    -    def __init__(self, j):
    
    37
    -        self.title = j["title"]
    
    38
    -        self.project, self.number = (
    
    39
    -            j["references"]["full"].rsplit("/", 2)[-1].split("#")
    
    40
    -        )
    
    41
    -        self.number = int(self.number)
    
    42
    -        self.platform = 0
    
    43
    -        self.num_platforms = 0
    
    44
    -        if "Desktop" in j["labels"]:
    
    45
    -            self.platform = Platform.DESKTOP
    
    46
    -            self.num_platforms += 3
    
    47
    -        else:
    
    48
    -            if "Windows" in j["labels"]:
    
    49
    -                self.platform |= Platform.WINDOWS
    
    50
    -                self.num_platforms += 1
    
    51
    -            if "MacOS" in j["labels"]:
    
    52
    -                self.platform |= Platform.MACOS
    
    53
    -                self.num_platforms += 1
    
    54
    -            if "Linux" in j["labels"]:
    
    55
    -                self.platform |= Platform.LINUX
    
    56
    -                self.num_platforms += 1
    
    57
    -        if "Android" in j["labels"]:
    
    58
    -            if is_mb and self.num_platforms == 0:
    
    59
    -                raise Exception(
    
    60
    -                    f"Android-only issue on Mullvad Browser: {j['references']['full']}!"
    
    61
    -                )
    
    62
    -            elif not is_mb:
    
    63
    -                self.platform |= Platform.ANDROID
    
    64
    -                self.num_platforms += 1
    
    65
    -        if not self.platform or (is_mb and self.platform == Platform.DESKTOP):
    
    66
    -            self.platform = Platform.ALL_PLATFORMS
    
    67
    -            self.num_platforms = 4
    
    68
    -        self.is_build = "Build System" in j["labels"]
    
    41
    +class ChangelogEntry:
    
    42
    +    def __init__(self, type_, platform, num_platforms, is_build):
    
    43
    +        self.type = type_
    
    44
    +        self.platform = platform
    
    45
    +        self.num_platforms = num_platforms
    
    46
    +        self.is_build = is_build
    
    69 47
     
    
    70 48
         def get_platforms(self):
    
    71 49
             if self.platform == Platform.ALL_PLATFORMS:
    
    ... ... @@ -81,15 +59,78 @@ class Issue:
    81 59
                 platforms.append("Android")
    
    82 60
             return " + ".join(platforms)
    
    83 61
     
    
    84
    -    def __str__(self):
    
    85
    -        return f"Bug {self.number}: {self.title} [{self.project}]"
    
    86
    -
    
    87 62
         def __lt__(self, other):
    
    63
    +        if self.type != other.type:
    
    64
    +            return self.type < other.type
    
    65
    +        if self.type == EntryType.UPDATE:
    
    66
    +            # Rely on sorting being stable on Python
    
    67
    +            return False
    
    88 68
             if self.project == other.project:
    
    89 69
                 return self.number < other.number
    
    90 70
             return project_order[self.project] < project_order[other.project]
    
    91 71
     
    
    92 72
     
    
    73
    +class UpdateEntry(ChangelogEntry):
    
    74
    +    def __init__(self, name, version):
    
    75
    +        if name == "Firefox" and not is_mb:
    
    76
    +            platform = Platform.DESKTOP
    
    77
    +            num_platforms = 3
    
    78
    +        elif name == "GeckoView":
    
    79
    +            platform = Platform.ANDROID
    
    80
    +            num_platforms = 3
    
    81
    +        else:
    
    82
    +            platform = Platform.ALL_PLATFORMS
    
    83
    +            num_platforms = 4
    
    84
    +        super().__init__(
    
    85
    +            EntryType.UPDATE, platform, num_platforms, name == "Go"
    
    86
    +        )
    
    87
    +        self.name = name
    
    88
    +        self.version = version
    
    89
    +
    
    90
    +    def __str__(self):
    
    91
    +        return f"Updated {self.name} to {self.version}"
    
    92
    +
    
    93
    +
    
    94
    +class Issue(ChangelogEntry):
    
    95
    +    def __init__(self, j):
    
    96
    +        self.title = j["title"]
    
    97
    +        self.project, self.number = (
    
    98
    +            j["references"]["full"].rsplit("/", 2)[-1].split("#")
    
    99
    +        )
    
    100
    +        self.number = int(self.number)
    
    101
    +        platform = 0
    
    102
    +        num_platforms = 0
    
    103
    +        if "Desktop" in j["labels"]:
    
    104
    +            platform = Platform.DESKTOP
    
    105
    +            num_platforms += 3
    
    106
    +        else:
    
    107
    +            if "Windows" in j["labels"]:
    
    108
    +                platform |= Platform.WINDOWS
    
    109
    +                num_platforms += 1
    
    110
    +            if "MacOS" in j["labels"]:
    
    111
    +                platform |= Platform.MACOS
    
    112
    +                num_platforms += 1
    
    113
    +            if "Linux" in j["labels"]:
    
    114
    +                platform |= Platform.LINUX
    
    115
    +                num_platforms += 1
    
    116
    +        if "Android" in j["labels"]:
    
    117
    +            if is_mb and num_platforms == 0:
    
    118
    +                raise Exception(
    
    119
    +                    f"Android-only issue on Mullvad Browser: {j['references']['full']}!"
    
    120
    +                )
    
    121
    +            elif not is_mb:
    
    122
    +                platform |= Platform.ANDROID
    
    123
    +                num_platforms += 1
    
    124
    +        if not platform or (is_mb and platform == Platform.DESKTOP):
    
    125
    +            platform = Platform.ALL_PLATFORMS
    
    126
    +            num_platforms = 4
    
    127
    +        is_build = "Build System" in j["labels"]
    
    128
    +        super().__init__(EntryType.ISSUE, platform, num_platforms, is_build)
    
    129
    +
    
    130
    +    def __str__(self):
    
    131
    +        return f"Bug {self.number}: {self.title} [{self.project}]"
    
    132
    +
    
    133
    +
    
    93 134
     def sorted_issues(issues):
    
    94 135
         issues = [sorted(v) for v in issues.values()]
    
    95 136
         return sorted(
    
    ... ... @@ -99,8 +140,20 @@ def sorted_issues(issues):
    99 140
         )
    
    100 141
     
    
    101 142
     
    
    102
    -if len(sys.argv) < 2:
    
    103
    -    print(f"Usage: {sys.argv[0]} version-to-release or #issue-id")
    
    143
    +parser = argparse.ArgumentParser()
    
    144
    +parser.add_argument("issue_version")
    
    145
    +parser.add_argument("--date", help="The date of the release")
    
    146
    +parser.add_argument("--firefox", help="New Firefox version (if we rebased)")
    
    147
    +parser.add_argument("--tor", help="New Tor version (if updated)")
    
    148
    +parser.add_argument("--no-script", help="New NoScript version (if updated)")
    
    149
    +parser.add_argument("--openssl", help="New OpenSSL version (if updated)")
    
    150
    +parser.add_argument("--ublock", help="New uBlock version (if updated)")
    
    151
    +parser.add_argument("--zlib", help="New zlib version (if updated)")
    
    152
    +parser.add_argument("--go", help="New Go version (if updated)")
    
    153
    +args = parser.parse_args()
    
    154
    +
    
    155
    +if not args.issue_version:
    
    156
    +    parser.print_help()
    
    104 157
         sys.exit(1)
    
    105 158
     
    
    106 159
     token_file = Path(__file__).parent / ".changelogs_token"
    
    ... ... @@ -121,7 +174,7 @@ with token_file.open() as f:
    121 174
         token = f.read().strip()
    
    122 175
     headers = {"PRIVATE-TOKEN": token}
    
    123 176
     
    
    124
    -version = sys.argv[1]
    
    177
    +version = args.issue_version
    
    125 178
     r = requests.get(
    
    126 179
         f"{API_URL}/projects/{PROJECT_ID}/issues?labels=Release Prep",
    
    127 180
         headers=headers,
    
    ... ... @@ -132,7 +185,7 @@ if r.status_code == 401:
    132 185
     issue = None
    
    133 186
     issues = []
    
    134 187
     for i in r.json():
    
    135
    -    if i["title"].find(sys.argv[1]) != -1:
    
    188
    +    if i["title"].find(version) != -1:
    
    136 189
             issues.append(i)
    
    137 190
     if len(issues) == 1:
    
    138 191
         issue = issues[0]
    
    ... ... @@ -172,20 +225,44 @@ iid = issue["iid"]
    172 225
     
    
    173 226
     linked = {}
    
    174 227
     linked_build = {}
    
    228
    +
    
    229
    +
    
    230
    +def add_entry(entry):
    
    231
    +    target = linked_build if entry.is_build else linked
    
    232
    +    if entry.platform not in target:
    
    233
    +        target[entry.platform] = []
    
    234
    +    target[entry.platform].append(entry)
    
    235
    +
    
    236
    +
    
    237
    +if args.firefox:
    
    238
    +    add_entry(UpdateEntry("Firefox", args.firefox))
    
    239
    +    if not is_mb:
    
    240
    +        add_entry(UpdateEntry("GeckoView", args.firefox))
    
    241
    +if args.tor and not is_mb:
    
    242
    +    add_entry(UpdateEntry("Tor", args.tor))
    
    243
    +if args.no_script:
    
    244
    +    add_entry(UpdateEntry("NoScript", args.no_script))
    
    245
    +if not is_mb:
    
    246
    +    if args.openssl:
    
    247
    +        add_entry(UpdateEntry("OpenSSL", args.openssl))
    
    248
    +    if args.zlib:
    
    249
    +        add_entry(UpdateEntry("zlib", args.zlib))
    
    250
    +    if args.go:
    
    251
    +        add_entry(UpdateEntry("Go", args.go))
    
    252
    +elif args.ublock:
    
    253
    +    add_entry(UpdateEntry("uBlock Origin", args.ublock))
    
    254
    +
    
    175 255
     r = requests.get(
    
    176 256
         f"{API_URL}/projects/{PROJECT_ID}/issues/{iid}/links", headers=headers
    
    177 257
     )
    
    178 258
     for i in r.json():
    
    179
    -    i = Issue(i)
    
    180
    -    target = linked_build if i.is_build else linked
    
    181
    -    if i.platform not in target:
    
    182
    -        target[i.platform] = []
    
    183
    -    target[i.platform].append(i)
    
    259
    +    add_entry(Issue(i))
    
    260
    +
    
    184 261
     linked = sorted_issues(linked)
    
    185 262
     linked_build = sorted_issues(linked_build)
    
    186 263
     
    
    187 264
     name = "Mullvad" if is_mb else "Tor"
    
    188
    -date = datetime.now().strftime("%B %d %Y")
    
    265
    +date = args.date if args.date else datetime.now().strftime("%B %d %Y")
    
    189 266
     print(f"{name} Browser {version} - {date}")
    
    190 267
     for issues in linked:
    
    191 268
         print(f" * {issues[0].get_platforms()}")
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits