Skip to content

chore(git): stop tracking pubspec.lock in library packages#40

Open
cemal-yilmaz-bt wants to merge 1 commit into
masterfrom
chore/gitignore-pubspec-lock
Open

chore(git): stop tracking pubspec.lock in library packages#40
cemal-yilmaz-bt wants to merge 1 commit into
masterfrom
chore/gitignore-pubspec-lock

Conversation

@cemal-yilmaz-bt

@cemal-yilmaz-bt cemal-yilmaz-bt commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What

Stop tracking pubspec.lock for the library packages under packages/dart/* (morph_core, morph_logger, morph_oauth2, morph_storage). Adds a scoped .gitignore rule and git rm --cacheds the four locks (files stay on disk).

poc/flutter-poc (an app) keeps its committed lock.

Why

Dart convention: libraries must not pin their dependency graph — consumers resolve their own versions; a committed library lock is meaningless downstream and only creates churn. Part of the microSDK handover lockfile-hygiene standardization (matching vnext-client-workflow-manager).

Safety

No CI/tooling depends on these locks — all jobs use plain dart pub get (no --enforce-lockfile). Verified dart pub get regenerates the now-ignored lock with a clean working tree.

🤖 Generated with Claude Code

Summary by Sourcery

Stop tracking Dart library package pubspec.lock files and ignore them in Git.

Chores:

  • Remove committed pubspec.lock files for Dart library packages under packages/dart/*.
  • Add a scoped .gitignore rule so library pubspec.lock files are ignored while keeping the app lockfile tracked.

Summary by CodeRabbit

  • Chores
    • Updated ignore rules to keep generated lockfiles out of library package folders.
    • Added guidance clarifying that example apps may still include their own lockfiles.

Library packages must not commit pubspec.lock (consumers resolve their
own versions); only apps/poc keep theirs. Part of the microSDK handover
lockfile-hygiene standardization.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cemal-yilmaz-bt
cemal-yilmaz-bt requested review from a team July 8, 2026 10:29
@sourcery-ai

sourcery-ai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Stops tracking pubspec.lock for Dart library packages under packages/dart/* by adding a scoped .gitignore rule and removing the lockfiles from version control while leaving app lockfiles intact.

File-Level Changes

Change Details Files
Add scoped ignore rule so Dart library pubspec.lock files are no longer tracked while keeping app lockfiles committed.
  • Add a .gitignore entry targeting pubspec.lock under Dart library package paths
  • Scope the ignore so it does not affect the flutter-poc app lockfile
.gitignore
Remove existing pubspec.lock files for Dart library packages from version control while leaving them on disk locally.
  • Run git rm --cached on library pubspec.lock files so they are deleted from the repo
  • Ensure the corresponding library lockfiles will be regenerated locally by dart pub get but remain untracked
packages/dart/morph_core/pubspec.lock
packages/dart/morph_logger/pubspec.lock
packages/dart/morph_oauth2/pubspec.lock
packages/dart/morph_storage/pubspec.lock

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 070f92b4-8b31-4351-bb23-352c035e0270

📥 Commits

Reviewing files that changed from the base of the PR and between 063f85d and 189a417.

⛔ Files ignored due to path filters (4)
  • packages/dart/morph_core/pubspec.lock is excluded by !**/*.lock
  • packages/dart/morph_logger/pubspec.lock is excluded by !**/*.lock
  • packages/dart/morph_oauth2/pubspec.lock is excluded by !**/*.lock
  • packages/dart/morph_storage/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • .gitignore

📝 Walkthrough

Walkthrough

Updated .gitignore to add an ignore rule excluding pubspec.lock files under packages/dart/* for Dart library packages, along with a comment clarifying that example apps may keep their lockfiles committed.

Changes

Gitignore Update

Layer / File(s) Summary
Ignore rule for Dart lockfiles
.gitignore
Added a pattern excluding packages/dart/*/pubspec.lock with a comment explaining library packages should not commit this file.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: stopping pubspec.lock tracking for Dart library packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/gitignore-pubspec-lock

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the .gitignore file to prevent committing pubspec.lock files for Dart library packages, and removes an existing pubspec.lock file from the repository. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@sourcery-ai sourcery-ai Bot 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.

Hey - I've left some high level feedback:

  • If the new .gitignore rule is currently global, consider scoping it explicitly to packages/dart/*/pubspec.lock so app lockfiles (like poc/flutter-poc) can’t be accidentally ignored in the future.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- If the new `.gitignore` rule is currently global, consider scoping it explicitly to `packages/dart/*/pubspec.lock` so app lockfiles (like `poc/flutter-poc`) can’t be accidentally ignored in the future.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant