feat(cli): detect Postman deploy source from git commit message#14768
feat(cli): detect Postman deploy source from git commit message#14768matlegault wants to merge 6 commits intomainfrom
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
6c60ed6 to
1e0b7dd
Compare
030b37b to
4ac2818
Compare
23e81c6 to
f40db0a
Compare
| publishing. This allows Postman-triggered deployments to be identified | ||
| in the dashboard activity log without requiring workflow template changes. | ||
| type: feat | ||
| createdAt: "2026-04-08" |
There was a problem hiding this comment.
The createdAt date for version 4.66.0 is "2026-04-08", which is earlier than the createdAt date of the older version 4.65.3 ("2026-04-10"). This creates a chronological inconsistency where a newer version has an earlier creation date than an older version.
If the versioning system or changelog relies on chronological ordering, this could cause issues with:
- Version sorting/ordering
- Changelog generation
- Release timelines
Fix: Update the createdAt date to match or be later than the current date:
createdAt: "2026-04-10"| createdAt: "2026-04-08" | |
| createdAt: "2026-04-10" |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
Co-Authored-By: mathieu <mathieu@buildwithfern.com>
… var Read the git commit subject via 'git log -1 --format=%s' and check for the [source:postman] marker. This removes the dependency on the FERN_DEPLOY_SOURCE env var and works for all repos immediately without requiring a workflow template update. Co-Authored-By: mathieu <mathieu@buildwithfern.com>
Co-Authored-By: mathieu <mathieu@buildwithfern.com>
Co-Authored-By: mathieu <mathieu@buildwithfern.com>
Co-Authored-By: mathieu <mathieu@buildwithfern.com>
a3663f7 to
3bd3e59
Compare
Co-Authored-By: mathieu <mathieu@buildwithfern.com>
Description
Refs fern-api/fern-platform#9560 (companion PR)
Adds support for detecting when a docs deployment was triggered by a Postman collection update, by inspecting the git commit message for a
[source:postman]marker. When found, the CLI includesdeploySource: "postman"in theX-CI-SourceJSON header sent to FDR during docs publishing, so the dashboard can show a Postman indicator in the deployment activity log.This approach detects the source directly from the commit message rather than requiring a custom workflow step to set an env var — meaning it works for all existing Postman-integrated repos on day one without any workflow template changes.
Changes Made
deploySource?: stringfield to theCISourceinterface (in all three locations where it's defined)detectDeploySource()helper that runsgit log -1 --format=%sand checks for[source:postman]in the commit subjectdetectCISource()now callsdetectDeploySource()only after a CI environment is confirmed — the git exec is never spawned on local dev machinesdetectCISource()from separateifblocks with early returns to anif/else ifchain that builds asourceobject, then conditionally enriches it withdeploySourcestdio: "pipe"to prevent stderr from leaking to the user's terminal when git is unavailableconsole.debuglevel for diagnosabilityversions.ymlentry for v4.67.0 (minor bump for feat)Testing
pnpm run check)pnpm check:biome)Reviewer Checklist
detectDeploySource()usesexecSyncwhich blocks the event loop. The 5s timeout bounds the worst case, and this only runs once per CLI invocation and only when already inside a recognized CI environment. Worth confirming this is acceptable.git log -1 --format=%sreads the HEAD commit subject. For merge commits or squash merges, verify the[source:postman]marker propagates to the final commit subject (the fern-platform companion PR controls the commit message format).CISourceinterfaces: The field was added to all three duplicate definitions (environment.ts,publishDocs.ts,runRemoteGenerationForDocsWorkspace.ts). The duplication is pre-existing.detectDeploySource()shells out to git so it's not easily unit-testable without mockingexecSync. The function is small and defensive (try/catch + timeout). Consider whether integration coverage is sufficient.deploySourceis a new non-URL string field in theX-CI-SourceJSON. FDR'ssanitizeCiSourceonly strips URL fields (runUrl), so this passes through untouched. No FDR changes needed.Updates since last revision
detectDeploySource(): Moved theexecSyncgit call so it only runs after a CI environment (GitHub/GitLab/Bitbucket) has been confirmed. Previously it ran unconditionally at the top ofdetectCISource(), which could block local dev machines for up to 5s with no benefit.detectCISource()from separateifblocks with early returns toif/else ifchain, building asourcevariable that gets enriched withdeploySourcebefore returning.Link to Devin session: https://app.devin.ai/sessions/9b2a038d4ebb47039520482f78e4a254
Requested by: @matlegault