Skip to content

Improve the profiler-cli publish script and document the whole deployment in a better way - #6260

Open
canova wants to merge 4 commits into
firefox-devtools:mainfrom
canova:improve-deploy
Open

Improve the profiler-cli publish script and document the whole deployment in a better way#6260
canova wants to merge 4 commits into
firefox-devtools:mainfrom
canova:improve-deploy

Conversation

@canova

@canova canova commented Aug 14, 2026

Copy link
Copy Markdown
Member

Main | Deploy preview

Previously the yarn publish-cli wasn't working properly, and that's why I had to use npm publish ... manually every time, but that's quite prone to errors. I improved that script and updated the whole documentation so it's easier to follow.

These are the things I did, please look at their own commits to see their details:

Since I didn't want to publish to our own npmjs package while testing, I used a local verdaccio server to host it and verified that the script indeed works now.
Also it looks like there are a lot more changes made than it actually is in deploying.md, mostly because some sections are shifted around and git can't figure that out.

@canova
canova requested review from fatadel and mstange August 14, 2026 11:16
canova added 4 commits August 14, 2026 13:17
…stry

Yarn 1 sets npm_config_registry to https://registry.yarnpkg.com in the
environment of every script it runs. The npm publish spawned by this script
inherited that and tried to upload to the Yarn mirror, which is read-only and
doesn't receive the token that ~/.npmrc scopes to registry.npmjs.org, so the
publish failed to authenticate. Fixed this issue by setting
publishConfig.registry in package.json, which npm applies at publish
time regardless of how it was invoked, and by dropping the inherited
npm_* variables when the script spawns npm so it sees the same
environment it would in a plain shell.
npm publish needs a token in ~/.npmrc to start at all, and fails with ENEEDAUTH
instead of offering to log you in, so a stale token would only surface after
yarn test-all had already run. Check npm whoami up front and run npm login when
it fails, which keeps the interactive part at the beginning and skips it when
the existing token is still good. The browser round trip npm makes at publish
time is the 2FA check on the upload itself and still happens either way.
yarn build-cli bundles the working copy rather than a commit, so
anything uncommitted at publish time ends up in the tarball on npm with
no commit or tag matching what users install.

Check `git status --porcelain` before the npm login and the test run,
print what is dirty and stop there. Untracked files count too, since a
source file that isn't committed yet still gets bundled.
The deploying document was outdated a bit since we added the cli and
changed the deployment process for a few times.

This commit reorganizes the file a bit so we have the whole step
indicated properly and with the proper release order. And it also adds a
step by step list at the top summarizes everything.
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.73%. Comparing base (1198e50) to head (765f2d1).
⚠️ Report is 39 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6260   +/-   ##
=======================================
  Coverage   83.73%   83.73%           
=======================================
  Files         350      350           
  Lines       37523    37524    +1     
  Branches    10543    10552    +9     
=======================================
+ Hits        31420    31421    +1     
  Misses       5676     5676           
  Partials      427      427           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant