Skip to content

fix: find the versions directory through symlinks - #55

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/jd/fix/discovery-symlinks/find-versions-dir-symlinks--3921767a
Sep 24, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
devs/jd/fix/discovery-symlinks/find-versions-dir-symlinks--3921767a

Conversation

@jd

@jd jd commented Sep 24, 2026

Copy link
Copy Markdown
Member

_discover_versions_dir compared each frame's resolved path with this
package's unresolved directory, and returned the caller's resolved
directory. Two setups broke:

  • The package imported through a symlinked path (for instance
    uv sync --link-mode symlink, where every site-packages file is a
    symlink into the cache): its own frames were not recognized, so the
    package directory was returned as the versions directory and building
    the chain failed on _chain.py.
  • A versions/ directory that is itself a symlink: the CLI writes
    revision_chain.json beside the path it is given, but discovery
    resolved the symlink and looked for the file beside its target.

Compare against the resolved package directory, and return the caller's
directory as alembic loaded it (absolute, symlinks kept). Both cases get
a regression test that fails before this change.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com

`_discover_versions_dir` compared each frame's resolved path with this
package's unresolved directory, and returned the caller's resolved
directory. Two setups broke:

- The package imported through a symlinked path (for instance
  `uv sync --link-mode symlink`, where every site-packages file is a
  symlink into the cache): its own frames were not recognized, so the
  package directory was returned as the versions directory and building
  the chain failed on `_chain.py`.
- A `versions/` directory that is itself a symlink: the CLI writes
  `revision_chain.json` beside the path it is given, but discovery
  resolved the symlink and looked for the file beside its target.

Compare against the resolved package directory, and return the caller's
directory as alembic loaded it (absolute, symlinks kept). Both cases get
a regression test that fails before this change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Change-Id: I3921767a64f5c44b4dbbb711eb17030122b71d75
Copilot AI lite review requested due to automatic review settings September 24, 2026 11:51
@jd

jd commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix: find the versions directory through symlinks #55 👈
2 perf: tell this package's frames apart without resolving paths #56

@mergify
mergify Bot deployed to Mergify Merge Protections September 24, 2026 11:51 Active
@jd
jd added this pull request to stack #57 September 24, 2026 11:51
@mergify
mergify Bot requested a review from a team September 24, 2026 11:52
@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=all-greens

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by>=1
    • author = dependabot[bot]
    • author = mergify-ci-bot

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes are covered by regression tests and no unresolved issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Fixes version-directory discovery when package or migration paths use symlinks.

Changes:

  • Resolves package paths for stack-frame matching.
  • Preserves absolute symlinked migration paths.
  • Adds regression tests for both scenarios.
File Description
tests/​test_chain.py Adds symlink regression coverage.
alembic_git_revisions/​_chain.py Updates symlink-aware directory discovery.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jd
jd marked this pull request as ready for review September 24, 2026 12:03
@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-24 13:53 UTC · Rule: default · triggered by merge protections
  • ✅ Checks skipped · PR is already up-to-date
  • 🚫 Left the queue — 2026-09-24 13:54 UTC · at 149153bcd81958194f0a51615a2b600746ca1820

This pull request spent 13 seconds in the queue, including 1 second running CI.

Reason

Pull request #55 has been dequeued

GitHub refused to merge the pull request. Cannot update this protected ref. This is usually enforced by a [branch protection](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) or [ruleset rule](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets).

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Required conditions to merge

Requeued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-24 14:10 UTC · Rule: default · triggered by @jd with the merge queue checkbox
  • ✅ Checks skipped · PR is already up-to-date
  • 🚫 Left the queue — 2026-09-24 14:10 UTC · at 149153bcd81958194f0a51615a2b600746ca1820

This pull request spent 14 seconds in the queue, including 2 seconds running CI.

Reason

Pull request #55 has been dequeued

GitHub refused to merge the pull request. Cannot update this protected ref. This is usually enforced by a [branch protection](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) or [ruleset rule](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets).

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Required conditions to merge

Requeued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added queued and removed queued labels Sep 24, 2026
@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-24 14:24 UTC · Rule: default · triggered by @jd with the merge queue checkbox
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-09-24 14:24 UTC · at 6b80b4b10bea8ff643fbaee12ab88ce2ec77c1f9 · squash

This pull request spent 22 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Sep 24, 2026
@mergify
mergify Bot merged commit 6b80b4b into main Sep 24, 2026
9 checks passed
@mergify mergify Bot removed the dequeued label Sep 24, 2026
@mergify
mergify Bot deleted the devs/jd/fix/discovery-symlinks/find-versions-dir-symlinks--3921767a branch September 24, 2026 14:24
@mergify mergify Bot removed the queued label Sep 24, 2026

This branch was successfully deployed

1 active deployment
Mergify Merge Protections — 149153bc Deployed Sep 24, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants