Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-14485] Remove manifest and index.html logic from gulp #11861

Merged
merged 15 commits into from
Nov 18, 2024
Merged

Conversation

Hinton
Copy link
Member

@Hinton Hinton commented Nov 5, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-14485

📔 Objective

Refactor the remaining logic from gulp.

Part of the browser build script refactor effort. bitwarden.atlassian.net/browse/PM-6683

Webpack is now responsible for performing most of the operations previously done by gulp. This includes:

  • Setting browser specific class
  • Building the manifest file

The package.json is modified to include browser specific commands for build, build:prod, build:watch and dist.

Manifests

Manifests now uses the copy-webpack-plugin transform feature. The logic is located in apps/browser/webpack/manifest.js. It reads a template, which supports some basic operations primarily overriding with browser specific fields using __browser__.

The manifest.json for both regular and mv3 builds are identical to our existing manifests except:

  • applications renamed to browser_specific_settings.
  • permissions sorted alphabetically.

Safari build

Safari requires additional packaging commands. This is implemented as a powershell script due to the cross-platform nature, and since we generally require powershell in our distribution pipelines.

An alternative would be to write it in bash, but bash is less powerful and would require some additional commands like jq. Another alternative is to write it using js, but that would require additional dependencies.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 33.47%. Comparing base (0cfe18a) to head (10c9777).
Report is 23 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11861      +/-   ##
==========================================
- Coverage   33.48%   33.47%   -0.01%     
==========================================
  Files        2844     2844              
  Lines       89044    89044              
  Branches    16987    16987              
==========================================
- Hits        29812    29805       -7     
- Misses      56887    56894       +7     
  Partials     2345     2345              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

justindbaur
justindbaur previously approved these changes Nov 5, 2024
Copy link
Member

@justindbaur justindbaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, I like it. We'll be able to delete all this 😀.

Copy link
Contributor

github-actions bot commented Nov 7, 2024

Logo
Checkmarx One – Scan Summary & Detailsd32620d9-7ca2-4c10-853f-c0c88d28ed95

New Issues

Severity Issue Source File / Package Checkmarx Insight
LOW Client_JQuery_Deprecated_Symbols /apps/cli/src/service-container/service-container.ts: 876 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 187
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 167
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 306
MEDIUM Unpinned Actions Full Length Commit SHA /deploy-web.yml: 190
MEDIUM Unpinned Actions Full Length Commit SHA /publish-cli.yml: 140
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 208
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1368
MEDIUM Unpinned Actions Full Length Commit SHA /build-web.yml: 204
MEDIUM Unpinned Actions Full Length Commit SHA /deploy-web.yml: 221
MEDIUM Unpinned Actions Full Length Commit SHA /publish-desktop.yml: 195
MEDIUM Unpinned Actions Full Length Commit SHA /publish-cli.yml: 103
MEDIUM Unpinned Actions Full Length Commit SHA /release-desktop.yml: 70
MEDIUM Unpinned Actions Full Length Commit SHA /release-desktop.yml: 93
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 254
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1319
MEDIUM Unpinned Actions Full Length Commit SHA /release-web.yml: 56
MEDIUM Unpinned Actions Full Length Commit SHA /crowdin-pull.yml: 34
MEDIUM Unpinned Actions Full Length Commit SHA /release-browser.yml: 95
MEDIUM Unpinned Actions Full Length Commit SHA /brew-bump-desktop.yml: 25
MEDIUM Unpinned Actions Full Length Commit SHA /build-cli.yml: 421
MEDIUM Unpinned Actions Full Length Commit SHA /publish-cli.yml: 180
MEDIUM Unpinned Actions Full Length Commit SHA /release-desktop-beta.yml: 667
MEDIUM Unpinned Actions Full Length Commit SHA /release-browser.yml: 43
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 305
MEDIUM Unpinned Actions Full Length Commit SHA /build-web.yml: 283
MEDIUM Unpinned Actions Full Length Commit SHA /deploy-web.yml: 269
MEDIUM Unpinned Actions Full Length Commit SHA /release-desktop-beta.yml: 247
MEDIUM Unpinned Actions Full Length Commit SHA /publish-web.yml: 43
MEDIUM Unpinned Actions Full Length Commit SHA /release-cli.yml: 43
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 915
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 372
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 194
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 201
MEDIUM Unpinned Actions Full Length Commit SHA /release-web.yml: 40
MEDIUM Unpinned Actions Full Length Commit SHA /publish-desktop.yml: 244
MEDIUM Unpinned Actions Full Length Commit SHA /staged-rollout-desktop.yml: 28
MEDIUM Unpinned Actions Full Length Commit SHA /build-web.yml: 314
MEDIUM Unpinned Actions Full Length Commit SHA /release-cli.yml: 58
MEDIUM Unpinned Actions Full Length Commit SHA /crowdin-pull.yml: 40
MEDIUM Unpinned Actions Full Length Commit SHA /version-auto-bump.yml: 40
MEDIUM Unpinned Actions Full Length Commit SHA /release-desktop-beta.yml: 50
MEDIUM Unpinned Actions Full Length Commit SHA /build-browser.yml: 372
MEDIUM Unpinned Actions Full Length Commit SHA /retrieve-current-desktop-rollout.yml: 22
MEDIUM Unpinned Actions Full Length Commit SHA /build-web.yml: 362
MEDIUM Unpinned Actions Full Length Commit SHA /release-desktop.yml: 43
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 114
MEDIUM Unpinned Actions Full Length Commit SHA /build-browser.yml: 416
MEDIUM Unpinned Actions Full Length Commit SHA /publish-desktop.yml: 121
LOW Unpinned Actions Full Length Commit SHA /version-auto-bump.yml: 40
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 372
LOW Unpinned Actions Full Length Commit SHA /build-web.yml: 283
LOW Unpinned Actions Full Length Commit SHA /build-cli.yml: 421
LOW Unpinned Actions Full Length Commit SHA /retrieve-current-desktop-rollout.yml: 22
LOW Unpinned Actions Full Length Commit SHA /build-web.yml: 204
LOW Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1319
LOW Unpinned Actions Full Length Commit SHA /publish-desktop.yml: 121
LOW Unpinned Actions Full Length Commit SHA /build-desktop.yml: 915
LOW Unpinned Actions Full Length Commit SHA /build-browser.yml: 372
LOW Unpinned Actions Full Length Commit SHA /publish-cli.yml: 180
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 254
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 167
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 194
LOW Unpinned Actions Full Length Commit SHA /release-desktop-beta.yml: 667
LOW Unpinned Actions Full Length Commit SHA /build-web.yml: 314
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 208
LOW Unpinned Actions Full Length Commit SHA /build-desktop.yml: 305
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 187
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 114
LOW Unpinned Actions Full Length Commit SHA /build-web.yml: 362
LOW Unpinned Actions Full Length Commit SHA /publish-desktop.yml: 195
LOW Unpinned Actions Full Length Commit SHA /crowdin-pull.yml: 40
LOW Unpinned Actions Full Length Commit SHA /publish-cli.yml: 103
LOW Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1368
LOW Unpinned Actions Full Length Commit SHA /build-browser.yml: 416
LOW Unpinned Actions Full Length Commit SHA /publish-desktop.yml: 244
LOW Unpinned Actions Full Length Commit SHA /brew-bump-desktop.yml: 25
LOW Unpinned Actions Full Length Commit SHA /publish-cli.yml: 140
LOW Unpinned Actions Full Length Commit SHA /staged-rollout-desktop.yml: 28
LOW Unpinned Actions Full Length Commit SHA /crowdin-pull.yml: 34
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 306
LOW Unpinned Actions Full Length Commit SHA /publish-web.yml: 43
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 201

@@ -125,20 +151,26 @@
"overlay/list.html",
"popup/fonts/*"
],
"applications": {
"__firefox__browser_specific_settings": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applications is deprecated since > 5 years ago, and we should use browser_specific_settings.

@Hinton Hinton marked this pull request as ready for review November 7, 2024 13:43
@Hinton Hinton changed the title Remove manifest and index.html logic from gulp [PM-14485] Remove manifest and index.html logic from gulp Nov 7, 2024
@Hinton Hinton requested a review from justindbaur November 7, 2024 13:45
justindbaur
justindbaur previously approved these changes Nov 7, 2024
@Hinton Hinton assigned Hinton and unassigned Hinton Nov 7, 2024
@@ -121,7 +121,7 @@ jobs:
PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }}
run: |
mv browser-source.zip browser-source-$PACKAGE_VERSION.zip
mv dist-chrome-mv3.zip dist-chrome-$PACKAGE_VERSION.zip
mv dist-chrome.zip dist-chrome-$PACKAGE_VERSION.zip
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bitwarden/dept-bre do we have any good way of testing the release flow? Run a dry-run in this branch and confirm it works?

justindbaur
justindbaur previously approved these changes Nov 13, 2024
vgrassia
vgrassia previously approved these changes Nov 13, 2024
@Hinton Hinton dismissed stale reviews from vgrassia and justindbaur via 10c9777 November 14, 2024 10:27
@Hinton Hinton requested a review from justindbaur November 14, 2024 10:28
Copy link
Contributor

@coroiu coroiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (only reviewed 10c9777)

@Hinton Hinton merged commit c388697 into main Nov 18, 2024
69 of 71 checks passed
@Hinton Hinton deleted the arch/remove-gulp branch November 18, 2024 10:50
Hinton added a commit that referenced this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants