Repository navigation
fix(push,pull): never take over same-named org resources without --adopt - #104
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
Contributor
Author
Devin Review🟢 Devin Review found nothing to fix · View findings |
dhruva-vapi
approved these changes
Nov 21, 2026
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Nov 21, 2026
1 of 2 tasks
dhruva-vapi
added a commit
to VapiAI/docs
that referenced
this pull request
Nov 24, 2026
## Description Documents the `--adopt` flag shipped in [VapiAI/gitops#104](VapiAI/gitops#104). - `fern/config-as-code.mdx`: new "Adopt an existing resource" section covering when to adopt (dashboard-created resources, renamed or moved files), `--adopt <resourceId>[=<uuid>]` on `push`/`apply`, the resource ID format, matching without a UUID, `--dry-run` previews, and `--dry-run --json` output for automation. - Checked against `src/adopt.ts`, `src/link-preflight.ts` and `src/push.ts` on gitops `main`. - Left out on purpose: the PR's validation and safety tightening, plus gitops#106 (`metadata.gitops.folderPath`). Nothing in the dashboard reads that field yet. ## Testing Steps - [x] `npx --yes fern-api check`: 0 errors - [ ] Check the Config as code page in the preview deployment <!-- devin-bot-banner-begin --> --- <p><picture><source srcset="https://app.devin.ai/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmdfeDgzMHFFaUNHMTlpNzZGNi9mOTVmNTA1Zi03MDE3LTRiYzUtODAxYS03ZDA2MTkzNjFlY2UiLCJpYXQiOjE3OTUyODE4MjksIm9yZ19pZCI6Im9yZ194ODMwcUVpQ0cxOWk3NkY2IiwiZmlsZW5hbWUiOiJib3QtYmFubmVyLnBuZyJ9.wfL-6vFLPjAVQvAhBIae5CKWZspG72VC9eYWRR3GPm0"><img height="63" alt="" align="left"></picture><strong><a href="https://app.devin.ai/bots/f980eb0dc44a4e4cb8725e2d8d721fb6">Technical Writer</a> opened this PR for Dhruva</strong><br> Implemented in session <a href="https://app.devin.ai/sessions/832ca0b861b94888888d8f774684e565">Update docs for recent product changes</a><br> <a href="https://app.devin.ai/review/VapiAI/docs/pull/1451">Review with Devin</a> · <a href="https://app.devin.ai/desktop/session/832ca0b861b94888888d8f774684e565?variant=devin">Open in Devin Desktop</a></p> <br clear="left"> <!-- devin-bot-banner-end -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GitOps no longer takes over an existing org resource just because its name matches a local file. A name match is reported, and taking over the resource needs an explicit
--adopt.ResourceStategains an optionalorigin: "pushed" | "pulled" | "adopted". A POST recordspushed, pull recordspulled, and--adoptrecordsadopted. Legacy{ uuid }entries stay linked and are not rewritten.asResourceState,upsertStateand the hash-store migration preserveorigin.src/recanonicalize.tsis deleted. A pulledfoo-<uuid8>key is no longer collapsed tofoobefore a push, and pull no longer links an untracked remote resource to a local file by name slug (findExistingResourceIdis removed). A localfoostays unlinked, and the new-file check now names the same-named org resource and points to--adopt foo.findExistingResourceByNameonly reuses state entries with originpushedoradopted. A match only against a pulled entry, a legacy entry or the live dashboard list now causes a POST of a new resource and a warning (type, name, UUID,--adopthint).--adopt <id>[=<uuid>](repeatable; push and apply): links a local file with no state entry to its single same-named candidate from state and the dashboard, or to the UUID you give. It errors on a missing file, an already-linked file, zero candidates, or ambiguous candidates. The adopted UUID is PATCHed as normal and other state aliases for it are removed.Name collisionssection listing every planned POST that matches an existing resource. It does GET-only inventory and printsnonewhen nothing matches. Behavior change:apply --dry-runnow skips the pull so local files and state are untouched, which means it previews current local state.--adopt fooremoves an alias such asfoo-<uuid8>, its local file is deleted automatically if it has no edits since the last sync, and its hash baseline is dropped too. If the file has edits, a terminal run asks first. A non-TTY run stops before any write. A dry run only reports what it would do.--jsonprints the same report once to stdout as[{file, resourceType, problem, fix, command}]for CI. The engine never passes--adoptor--allow-new-filesby itself.Docs: AGENTS.md (safety table, new-file check), README, commands/how-it-works/workflows guides, learnings, improvements.md.
Tests:
npm run build,npm test(595 pass), and Biome pass. New unit and local-HTTP integration tests cover provenance, pull without name linking, POST vs reuse, adoption, apply passthrough, and dry-run with no writes. No live org was touched.