Preserve a consumer's copyright default profile on migrate#731
Open
alexander-yevsyukov wants to merge 2 commits into
Open
Preserve a consumer's copyright default profile on migrate#731alexander-yevsyukov wants to merge 2 commits into
alexander-yevsyukov wants to merge 2 commits into
Conversation
`migrate` copies config's `.idea/` over the consumer's on every `./config/pull`, preserving only `.idea/misc.xml` and `module.gradle.kts`. That clobbers `.idea/copyright/profiles_settings.xml`, which selects the default copyright profile — and that choice is project-specific: proprietary repositories use `TeamDev Proprietary` while the open-source SDK repositories use `TeamDev Open-Source`. Overwriting it silently re-licenses the consumer's headers, and the `update-copyright` hook then applies the wrong notice on the next edit. Preserve an existing `profiles_settings.xml` across the `.idea` overlay, mirroring the `misc.xml` handling: config still seeds a consumer that has none, but an existing project-local copy wins. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the migrate script so that ./config/pull no longer overwrites a consumer repository’s IntelliJ default copyright profile selection (.idea/copyright/profiles_settings.xml) when overlaying config’s shared .idea/ directory. This prevents unintended header re-licensing in consumers where the default profile is intentionally project-specific.
Changes:
- Preserve an existing
../.idea/copyright/profiles_settings.xmlbefore copying config’s.idea/overlay. - Restore the preserved
profiles_settings.xmlafter the overlay, mirroring the existing.idea/misc.xmlpreservation logic.
Address review: the `profiles_settings.xml` preserve/restore was fail-open — a failed `cp` would let config's `.idea` overlay silently switch the consumer's default copyright profile, re-licensing its source headers. Abort on failure in both the preserve and restore steps (matching the `.gitignore` merge), and create the destination directory explicitly before restoring. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
migratecopies config's.idea/over the consumer's on every./config/pull, preserving only.idea/misc.xmlandmodule.gradle.kts. That clobbers.idea/copyright/profiles_settings.xml, which selects the default copyright profile — and that choice is project-specific: proprietary repositories useTeamDev Proprietarywhile the open-source SDK repositories useTeamDev Open-Source. Overwriting it silently re-licenses the consumer's headers, and theupdate-copyrighthook then applies the wrong notice on the next edit.Preserve an existing
profiles_settings.xmlacross the.ideaoverlay, mirroring themisc.xmlhandling: config still seeds a consumer that has none, but an existing project-local copy wins.