Skip to content

Fix NilClass passed to Pub cooldown in_cooldown_period? - #16362

Merged
v-robaiken merged 2 commits into
mainfrom
kbukum1/fix-cooldown-nil-release
Sep 21, 2026
Merged

v-robaiken merged 2 commits into
mainfrom
kbukum1/fix-cooldown-nil-release

Conversation

@v-kbukum1

@v-kbukum1 v-kbukum1 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

Fixes DELTAFORCE-1K1X.

Pub's cooldown filter could pass nil into in_cooldown_period?, which has a non-nilable signature.

  • Root cause: the cooldown lookup compared a Pub::Version object against a version String, so it never matched and always fed nil into the check. A side effect is that Pub cooldown effectively never applied.
  • Fix: compare on the string form so the matching release is found, and guard the no-release path.

Anything you want to highlight for special attention from reviewers?

The "can't apply cooldown" cases now have deliberately different semantics:

  • No registry metadata at all → mark the shared "Cooldown was not applied" notice (PR + job warning), matching docker/common.
  • Candidate diverges (dated releases exist, just not this resolver-proposed one) → skip cooldown for that candidate only, no global notice — the date source is healthy.
  • Matched, dated release → normal cooldown evaluation.

Only Pub reproduces this; sibling ecosystems (uv/python) go through common's array-iterating filter_by_cooldown, which never passes nil.

How will you know you've accomplished your goal?

New specs cover the divergence, empty-metadata, and within-cooldown paths; the existing suite, RuboCop, and Sorbet runtime signature validation pass.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

Copilot AI balanced review requested due to automatic review settings September 21, 2026 01:37
@github-actions github-actions Bot added the L: dart:pub Dart packages via pub label Sep 21, 2026

This comment was marked as resolved.

@v-kbukum1 v-kbukum1 self-assigned this Sep 21, 2026
Copilot AI review requested due to automatic review settings September 21, 2026 02:38
@v-kbukum1
v-kbukum1 force-pushed the kbukum1/fix-cooldown-nil-release branch from ee821fa to c2d1c6a Compare September 21, 2026 02:38
@v-kbukum1
v-kbukum1 force-pushed the kbukum1/fix-cooldown-nil-release branch from c2d1c6a to 19f5463 Compare September 21, 2026 02:42

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.

Copilot review overview

🟡 Changes recommended

Candidate-level warning state can leak into the ultimately selected update, and metadata completeness lacks direct coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (2)

Comment thread pub/lib/dependabot/pub/update_checker/latest_version_finder.rb
Comment thread pub/spec/dependabot/pub/update_checker/latest_version_finder_spec.rb Outdated
Copilot AI review requested due to automatic review settings September 21, 2026 02:42

This comment was marked as resolved.

@v-kbukum1
v-kbukum1 force-pushed the kbukum1/fix-cooldown-nil-release branch from 19f5463 to 08e0f01 Compare September 21, 2026 02:52
Copilot AI review requested due to automatic review settings September 21, 2026 02:52
@v-kbukum1
v-kbukum1 force-pushed the kbukum1/fix-cooldown-nil-release branch from 08e0f01 to b7c92bf Compare September 21, 2026 02:53

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings September 21, 2026 02:54

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings September 21, 2026 02:59
@v-kbukum1
v-kbukum1 force-pushed the kbukum1/fix-cooldown-nil-release branch from b7c92bf to e3f395c Compare September 21, 2026 02:59
@v-kbukum1
v-kbukum1 force-pushed the kbukum1/fix-cooldown-nil-release branch from e3f395c to 66d873a Compare September 21, 2026 03:02

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.

Copilot review overview

🔵 Needs a closer look

Unavailable-date warnings can be emitted for candidates subsequently excluded by ignored-version rules.

Review effort: Balanced
Findings: None

Resolved since last review (2)

Copilot AI review requested due to automatic review settings September 21, 2026 03:03

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.

Copilot review overview

🟢 Approval recommended

The implementation addresses the nil release path and its distinct fallback semantics with focused regression coverage.

Review effort: Balanced
Findings: None

@v-kbukum1
v-kbukum1 marked this pull request as ready for review September 21, 2026 03:12
@v-kbukum1
v-kbukum1 requested a review from a team as a code owner September 21, 2026 03:12
@v-robaiken
v-robaiken merged commit 1101c5b into main Sep 21, 2026
92 checks passed
@v-robaiken
v-robaiken deleted the kbukum1/fix-cooldown-nil-release branch September 21, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: dart:pub Dart packages via pub

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants