Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

fix(package-manager): re-import reporter and lockfile types in tests#370

Merged
zkochan merged 1 commit into
mainfrom
fix/install-test-imports
May 1, 2026
Merged

fix(package-manager): re-import reporter and lockfile types in tests#370
zkochan merged 1 commit into
mainfrom
fix/install-test-imports

Conversation

@zkochan

@zkochan zkochan commented May 1, 2026

Copy link
Copy Markdown
Member

Summary

#364's use super::*; removal in crates/package-manager/src/install.rs stripped the test module's view of LogEvent, Reporter, Stage, StageLog, and Lockfile, but the test bodies still reference them. As a result cargo nextest run -p pacquet-package-manager (and cargo check --tests) fails to compile on current main.

Promotes the inline use pacquet_lockfile::Lockfile from frozen_lockfile_flag_overrides_config_lockfile_false to the module-level use block (it's now needed by two tests), and adds the missing reporter symbols alongside the existing SilentReporter import.

Test plan

  • cargo check --workspace --tests — clean before this PR fails on the install.rs test module.
  • cargo nextest run -p pacquet-package-manager install_emits_stage_events_bracketing_the_run — passes (was a build error on main).
  • just ready — all checks pass.

Summary by CodeRabbit

  • Chores
    • Internal reorganization of test module imports for improved code organization.

#364's `use super::*;` removal stripped the test module's view of
`LogEvent`, `Reporter`, `Stage`, `StageLog`, and `Lockfile`, but the
test bodies still reference them — so `cargo nextest run -p
pacquet-package-manager` failed to compile on `main`.

Promote the inline `use pacquet_lockfile::Lockfile` from
`frozen_lockfile_flag_overrides_config_lockfile_false` to the module-
level `use` block, and add the missing reporter symbols alongside the
existing `SilentReporter` import. The two `Lockfile`-using tests now
share one import.
Copilot AI review requested due to automatic review settings May 1, 2026 20:14
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 83fa902b-b3d2-4fa2-858a-6b6ec47dca10

📥 Commits

Reviewing files that changed from the base of the PR and between b3344cc and 130bf29.

📒 Files selected for processing (1)
  • crates/package-manager/src/install.rs

📝 Walkthrough

Walkthrough

Test module imports in the package manager's install.rs are reorganized. The Lockfile type is consolidated into the module-level tests import scope, and pacquet_reporter imports are expanded to include LogEvent, Reporter, Stage, and StageLog alongside existing imports.

Changes

Cohort / File(s) Summary
Test Import Reorganization
crates/package-manager/src/install.rs
Consolidated Lockfile into shared tests scope imports and expanded pacquet_reporter imports to include additional types (LogEvent, Reporter, Stage, StageLog). Test implementations remain unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • refactor: no star imports #364: Both PRs adjust test import statements in crates/package-manager/src/install.rs, refining which symbols are imported for test modules.

Poem

🐰 Hops through imports with delight,
Tidying the test scope, getting it right,
Lockfile bundled, reporters expand,
Cleaner, shared imports, perfectly planned!

🚥 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 accurately describes the main change: re-importing reporter and lockfile types in tests to fix compilation errors after a prior refactoring.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/install-test-imports

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

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

Fixes pacquet-package-manager test compilation after the use super::*; removal by explicitly importing the reporter and lockfile types that the install.rs test module still references.

Changes:

  • Add missing pacquet_reporter symbols (LogEvent, Reporter, Stage, StageLog) to the test module imports.
  • Promote pacquet_lockfile::Lockfile to the test module-level imports and remove the now-redundant inline import in the affected test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.55%. Comparing base (76c6ffa) to head (130bf29).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #370   +/-   ##
=======================================
  Coverage   88.55%   88.55%           
=======================================
  Files          65       65           
  Lines        5769     5769           
=======================================
  Hits         5109     5109           
  Misses        660      660           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.02     16.4±0.67ms   264.5 KB/sec    1.00     16.0±0.14ms   270.7 KB/sec

@zkochan zkochan merged commit 7097cdc into main May 1, 2026
19 checks passed
@zkochan zkochan deleted the fix/install-test-imports branch May 1, 2026 20:20
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

Integrated-Benchmark Report (Linux)

Scenario: Frozen Lockfile

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.898 ± 0.084 2.796 3.036 1.04 ± 0.04
pacquet@main 2.777 ± 0.086 2.656 2.897 1.00
pnpm 6.527 ± 0.057 6.461 6.642 2.35 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8975224960599997,
      "stddev": 0.08368479917495718,
      "median": 2.8844843014599997,
      "user": 2.4661938999999995,
      "system": 3.50077644,
      "min": 2.79591527496,
      "max": 3.0361692689599997,
      "times": [
        3.0361692689599997,
        2.90175817596,
        2.94865159396,
        2.86721042696,
        2.99585243296,
        2.95234384796,
        2.80508775096,
        2.86031590296,
        2.81192028496,
        2.79591527496
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.77744772256,
      "stddev": 0.08601401017263496,
      "median": 2.79486991646,
      "user": 2.4461465,
      "system": 3.39236644,
      "min": 2.65641680596,
      "max": 2.89708060096,
      "times": [
        2.89708060096,
        2.80681742896,
        2.87051869996,
        2.80471367296,
        2.68941716696,
        2.65641680596,
        2.85975557996,
        2.67497117596,
        2.78502615996,
        2.72975993396
      ]
    },
    {
      "command": "pnpm",
      "mean": 6.52710920756,
      "stddev": 0.056653388752369985,
      "median": 6.50935006746,
      "user": 8.974433399999999,
      "system": 4.43548774,
      "min": 6.46085803196,
      "max": 6.64151394596,
      "times": [
        6.49831452596,
        6.59927055596,
        6.64151394596,
        6.48545969596,
        6.56310272996,
        6.51682487996,
        6.48704757496,
        6.50875408096,
        6.50994605396,
        6.46085803196
      ]
    }
  ]
}

Scenario: Frozen Lockfile (Hot Cache)

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 706.7 ± 28.6 682.3 777.7 1.00
pacquet@main 768.2 ± 95.3 689.5 995.3 1.09 ± 0.14
pnpm 2609.0 ± 106.9 2494.6 2814.4 3.69 ± 0.21
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.70669045418,
      "stddev": 0.02859501867953192,
      "median": 0.69667696398,
      "user": 0.23914899999999997,
      "system": 1.3653311200000002,
      "min": 0.68233409898,
      "max": 0.7776882509799999,
      "times": [
        0.7776882509799999,
        0.68852727898,
        0.72760248498,
        0.7123153329799999,
        0.68422351498,
        0.69370445798,
        0.70833354598,
        0.69252610598,
        0.68233409898,
        0.69964946998
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.76820266508,
      "stddev": 0.09531978191692816,
      "median": 0.72363024098,
      "user": 0.2468383,
      "system": 1.35228792,
      "min": 0.6894952169799999,
      "max": 0.99530150698,
      "times": [
        0.82442188798,
        0.70058360998,
        0.83037788498,
        0.99530150698,
        0.72787812198,
        0.69536563598,
        0.71497480398,
        0.6894952169799999,
        0.71938235998,
        0.78424562198
      ]
    },
    {
      "command": "pnpm",
      "mean": 2.60897643748,
      "stddev": 0.10687135866816494,
      "median": 2.5702235934799997,
      "user": 3.126021599999999,
      "system": 2.18086542,
      "min": 2.49462101398,
      "max": 2.81437041698,
      "times": [
        2.81437041698,
        2.59919780898,
        2.59036610298,
        2.75397859498,
        2.53562937098,
        2.52527319598,
        2.54180417298,
        2.49462101398,
        2.68444261298,
        2.55008108398
      ]
    }
  ]
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants