Skip to content

Preserve a consumer's copyright default profile on migrate#731

Open
alexander-yevsyukov wants to merge 2 commits into
masterfrom
fix/preserve-copyright-profiles-settings
Open

Preserve a consumer's copyright default profile on migrate#731
alexander-yevsyukov wants to merge 2 commits into
masterfrom
fix/preserve-copyright-profiles-settings

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

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.

`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>
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jul 8, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review July 8, 2026 20:19
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jul 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xml before copying config’s .idea/ overlay.
  • Restore the preserved profiles_settings.xml after the overlay, mirroring the existing .idea/misc.xml preservation logic.

Comment thread migrate
Comment thread migrate
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>
@alexander-yevsyukov alexander-yevsyukov moved this from 🏗 In progress to In Review in v2.0 Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants