feat!: fill commitInfo from CI variables and release 2.0.0 - #13
Conversation
|
| Topic | Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Commit metadata flow | Unify commit metadata resolution across Git, fallback environment variables, and supported CI providers, including pull-request data, detached branches, safe-directory retries, credential removal, and one-time diagnostics.Modified files (6)
Latest Contributors(2)
| |||||||||
| Public API release | Publish the breaking 2.0.0 API with TypeScript declarations, documented migration behavior, new CI and credential helpers, and reduced runtime dependencies.Modified files (5)
Latest Contributors(2)
|
|
Warning Review limit reached
This review includes 9 billable files and costs up to $2.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 13 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 64 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
Comment |
ddab3f7 to
2e9587c
Compare
commitInfo() takes each field from COMMIT_INFO_*, then git, then the CI provider's variables, so the Currents CLI and reporter no longer combine them themselves. The CI values are the ones the Playwright reporter read. Branch values from COMMIT_INFO_BRANCH and CI are not changed; git's HEAD is still no branch. When git fails and fields stay empty, commitInfo() prints one warning per process with the git error and the COMMIT_INFO_* variables to set. It says so plainly when git is not in PATH. Outside a repository and off CI there is no warning. Adds TypeScript types. ramda is no longer used. BREAKING CHANGE: commitInfo() returns CI provider values where 1.x returned null, and can print a warning to stderr. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
commitInfo() returns COMMIT_INFO_REMOTE, else the CI provider's remote, else the git remote, as the Playwright reporter did with CI_PREFERRED_KEYS (ENG-563). An Azure Pipelines clone often has an SSH remote, and the pull request link needs the HTTPS URL in BUILD_REPOSITORY_URI. The providers that set a remote are AWS CodeBuild, Azure Pipelines, Bamboo, Buildkite, CircleCI, Drone, GitLab, Semaphore and Netlify. Credentials are removed as before. BREAKING CHANGE: on those providers commitInfo().remote is the CI provider's remote, not the git remote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
2e9587c to
d75c2ff
Compare
Node reports a cwd that does not exist as `spawn git ENOENT`, the same error
as a missing git, so commitInfo('/missing') warned that git was not in PATH.
A folder that does not exist now counts as no repository: no warning outside
CI, and on CI the warning names the folder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
getGhaEventData copies the fields from the GitHub event payload without checking them, so a payload without a sender gives undefined senderAvatarUrl and senderHtmlUrl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
…iteral type The generic return type kept a literal input type, such as 'https://user:token@host/x', although the function returns a different string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
commitInfo()fills the fields git can't read from the CI provider's variables, takesremotefrom the CI provider before git, and prints one warning when git fails. These are the rules the Currents Playwright reporter applied itself; after this release the Playwright reporter and the CLI both drop their own copy and get the same values from here. Releases 2.0.0.Breaking, because
commitInfo()returns other values than 1.x:COMMIT_INFO_*, then git, then the CI provider. A detached HEAD is no branch; branch values are not otherwise rewritten.remote:COMMIT_INFO_REMOTE, then the CI provider, then git, without credentials. Azure clones over SSH, and the CI variable has the pull request's HTTPS URL (ENG-563).SEMAPHORE_GIT_URLinstead ofSEMAPHORE_GIT_REPO_SLUG(owner/repo), which the server can't build commit links from.bamboo_planRepository_repositoryUrl; the reporter read…repositoryURL, which Bamboo doesn't set.COMMIT_INFO_*variables to set. No warning outside a repository on a developer machine.index.d.tswith the types;ramdaremoved.The CHANGELOG has the migration steps.
Verification
npm test: 113 passing, also on Node 16.20.2 and withCI=true GITHUB_ACTIONS=true.npm run lint,depsandsizepass.COMMIT_INFO_*sets, 12,096 runs, 0 crashes). Every difference is one of: credentials removed, dubious ownership read on CI,COMMIT_INFO_REMOTEwinning, the warning, the Semaphore and Bamboo fixes, or the CLI now matching the old Playwright reporter. No other differences. After the switch both consumers return identical commit fields in every scenario.DEBUG=*.Stacked on #12.
🤖 Generated with Claude Code
https://claude.ai/code/session_018KVkH9Ei4iCN2WvGMAUT1d
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.