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 version checking #144

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add version checking #144

wants to merge 3 commits into from

Conversation

gvocstr
Copy link

@gvocstr gvocstr commented Jan 30, 2025

By submitting a PR to this repository, you agree to the terms within the Checkmarx Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

Currently, the program always outputs the CLI version on each run. These changes replace that section with an automatic version check using the tags in this repository:

Running the latest version:

[2025-01-30T11:44:44,879 INFO ] -----------------------------------------------------------------------------------------
[2025-01-30T11:44:44,880 INFO ] CxConsole Configuration:
[2025-01-30T11:44:44,880 INFO ] --------------------
[2025-01-30T11:44:45,418 INFO ] Current version: 1.1.36
[2025-01-30T11:44:45,418 INFO ] Latest version: 1.1.36
[2025-01-30T11:44:45,419 INFO ] You are running the latest version.
[2025-01-30T11:44:45,419 INFO ] --------------------

Running an outdated version:

[2025-01-30T11:22:15,200 INFO ] -----------------------------------------------------------------------------------------
[2025-01-30T11:22:15,230 INFO ] CxConsole Configuration:
[2025-01-30T11:22:16,230 INFO ] --------------------
[2025-01-30T11:22:16,600 INFO ] Current version: 1.1.33
[2025-01-30T11:22:16,600 INFO ] Latest version: 1.1.36
[2025-01-30T11:22:16,602 INFO ] A new version is available: 1.1.36. Please visit checkmarx.com/plugins and download the latest version.
[2025-01-30T11:22:16,602 INFO ] --------------------

This allows the users to have more context on the version they're running and then act accordingly to ensure they're up to date with the latest changes.

References

N/A

Testing

This was tested building the latest current version, 1.1.36, and also the previous one, 1.1.33. The plugin reacts correctly according to these two scenarios.
A connection timeout (5000 ms) was added to ensure pipelines don't hang unnecessarily on this arguably non-critical step.
Given that are companies that block access to GitHub, this was also tested. When access to GH is blocked, the error gets logged out properly without breaking the build.

Checklist

  • I have added documentation for new/changed functionality in this PR (if applicable). If documentaiton is a Wiki Update, please indicate desired changes within PR MD Comment
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant