Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add npm_and_yarn package managers' requirements to ecosystem metrics #10977

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

kbukum1
Copy link
Contributor

@kbukum1 kbukum1 commented Nov 20, 2024

What are you trying to accomplish?

This PR adds the ability to extract and report package manager version constraints for npm, pnpm, and yarn from the engines field in the package.json manifest file.

By including these constraints, the ecosystem metrics now provide better visibility into the range of supported package manager versions used in projects.

What issues does this affect or fix?

This PR enhances ecosystem metrics tracking for the npm_and_yarn ecosystem by introducing package manager version requirement collection and normalization for npm, pnpm, and yarn.

Anything you want to highlight for special attention from reviewers?

  • Review the extraction logic for the engines field to ensure it handles constraints properly for npm, pnpm, and yarn.
  • Validate that the conversion logic accurately transforms raw versions like 1.3.4 into =1.3.4.
  • Consider edge cases where the engines field may contain incomplete or malformed version constraints.

How will you know you've accomplished your goal?

  • The extracted package manager constraints for npm, pnpm, and yarn are correctly represented in the ecosystem metrics.
  • All tests pass, including new tests that cover the extraction and conversion logic.
  • The system handles invalid or edge-case engines fields gracefully.

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.

@kbukum1 kbukum1 force-pushed the kamil/add_npm_yarn_pm_reqs_to_ecosystem_metrics branch 2 times, most recently from 5edb762 to 78740b1 Compare November 21, 2024 01:49
@kbukum1 kbukum1 self-assigned this Nov 21, 2024
update common requirements to handle min, max properly
@kbukum1 kbukum1 force-pushed the kamil/add_npm_yarn_pm_reqs_to_ecosystem_metrics branch from 37a0210 to 8a2a7ec Compare November 25, 2024 21:16
@kbukum1 kbukum1 marked this pull request as ready for review November 25, 2024 21:44
@kbukum1 kbukum1 requested a review from a team as a code owner November 25, 2024 21:44

# Methods for handling maximum constraints
sig { params(version: Dependabot::Version).returns(Dependabot::Version) }
def handle_lte_max(version)
Copy link
Member

Choose a reason for hiding this comment

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

can you write the method names in full?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is done.

@kbukum1 kbukum1 merged commit 8964345 into main Nov 26, 2024
129 checks passed
@kbukum1 kbukum1 deleted the kamil/add_npm_yarn_pm_reqs_to_ecosystem_metrics branch November 26, 2024 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants