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 Detected Version to Base Version Manager and Update Ecosystem Package Managers and Languages #11190

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

kbukum1
Copy link
Contributor

@kbukum1 kbukum1 commented Dec 27, 2024

What are you trying to accomplish?

This pull request introduces the detected_version parameter to the VersionManager base class and updates all package manager and language-specific implementations to use explicit named parameters during initialization.

The rationale behind this change is to enhance clarity and maintainability. Currently, package managers and languages are used for deprecation/unsupported functionality and metrics collection related to package manager and language versions during Dependabot runs. Since the detected_version and the existing version parameter represent distinct concepts, this update ensures they remain separate in the codebase, reducing potential confusion and improving maintainability.

Why?

  • To improve clarity by explicitly distinguishing between detected_version and version.
  • To standardize parameter passing across implementations for consistency and maintainability.

This change aims to eliminate ambiguity in parameter handling while aligning with best practices for code readability and robustness.

Anything you want to highlight for special attention from reviewers?

  • Ensure that the parameter updates in all package managers and languages are consistent and correctly implemented.
  • Confirm that no existing functionality is affected by these changes.
  • Check the naming convention for parameters to ensure they are intuitive and self-explanatory.

How will you know you've accomplished your goal?

  • All tests and linters pass successfully.
  • Updated implementations adhere to the named parameter convention.
  • Code reviews confirm the clarity and correctness of the detected_version integration.

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.

@github-actions github-actions bot added L: php:composer Issues and code for Composer L: ruby:bundler RubyGems via bundler L: elixir:hex Elixir packages via hex L: java:gradle Maven packages via Gradle L: go:modules Golang modules L: elm Elm packages L: git:submodules Git submodules L: terraform Terraform packages L: rust:cargo Rust crates via cargo L: dotnet:nuget NuGet packages via nuget or dotnet L: java:maven Maven packages via Maven L: dart:pub Dart packages via pub L: javascript L: python L: swift Swift packages L: devcontainers labels Dec 27, 2024
raw_version: version_manager.version.to_semver.to_s,
version: version_manager.version.to_s,
raw_version: raw_version.empty? ? "N/A" : raw_version,
version: version.empty? ? "N/A" : version,
Copy link
Contributor Author

@kbukum1 kbukum1 Dec 27, 2024

Choose a reason for hiding this comment

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

Review Tip: We want to send N/A for non version package managers

@kbukum1 kbukum1 marked this pull request as ready for review December 28, 2024 00:17
@kbukum1 kbukum1 requested review from a team as code owners December 28, 2024 00:17
@kbukum1 kbukum1 requested review from amazimbe and robaiken December 30, 2024 18:19
Copy link
Member

@randhircs randhircs left a comment

Choose a reason for hiding this comment

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

As per the conversation, this change is more than improving readability. there are business cases where it will differ.
Additionally, I do see added explicit null check been added.
I approve it.

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 L: devcontainers L: dotnet:nuget NuGet packages via nuget or dotnet L: elixir:hex Elixir packages via hex L: elm Elm packages L: git:submodules Git submodules L: go:modules Golang modules L: java:gradle Maven packages via Gradle L: java:maven Maven packages via Maven L: javascript L: php:composer Issues and code for Composer L: python L: ruby:bundler RubyGems via bundler L: rust:cargo Rust crates via cargo L: swift Swift packages L: terraform Terraform packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants