Skip to content

SCANPY-145 Dynamically infer the OS and Architecture properties#165

Closed
guillaume-dequenne wants to merge 4 commits intomasterfrom
SCANPY-145
Closed

SCANPY-145 Dynamically infer the OS and Architecture properties#165
guillaume-dequenne wants to merge 4 commits intomasterfrom
SCANPY-145

Conversation

@guillaume-dequenne
Copy link
Copy Markdown
Contributor

@guillaume-dequenne guillaume-dequenne commented Mar 26, 2025

SCANPY-145

Due to the fact that our config is string based, I initially removed the Os and Arch enums. Seeing that this led to relying a bit too much on string literals, I added the second commit to keep these classes, simplifying tests in particular.
It may be a bit overkill, so I left it as a separate commit in case you'd like to challenge the approach.

@guillaume-dequenne guillaume-dequenne force-pushed the SCANPY-145 branch 2 times, most recently from f2e583d to a02a50d Compare March 26, 2025 13:24
@guillaume-dequenne guillaume-dequenne changed the title SCANPY-145 tmp SCANPY-145 Dynamically infer the OS and Architecture properties Mar 26, 2025
Copy link
Copy Markdown
Contributor

@Seppli11 Seppli11 left a comment

Choose a reason for hiding this comment

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

The change itself looks good to me!

I've left two questions and put it back into "in progress"

Comment thread tests/test_configuration_loader.py Outdated
Comment thread tests/test_configuration_loader.py Outdated
Comment thread tests/sq_api_utils.py
def mock_analysis_jres(
self,
body: Optional[list[dict]] = None,
os_matcher: Optional[str] = None,
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.

I'm not sure I understand why this was removed...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In absolute, it probably makes sense to keep it. However, doing so breaks the existing tests where no matcher is defined because we'll now always provide os and arch.
Since we already have quite a few tests for the configuration of the resolver, I felt it didn't really make sense to perform a complete refactoring of the tests and add more to have specific matchers for os/architectures, so I decided to drop it.
If you think we still need it, I can revisit and adapt the tests though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As discussed, I added the matchers back, with default values, as well as a small test using different OS/Arch combination to make sure that part works as well. Thanks for the feedback!

@sonarqube-next
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@Seppli11 Seppli11 left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for the quick changes. It's really nice that the SONAR_PROJECT_BASE_DIR path is explicit now.

@guillaume-dequenne
Copy link
Copy Markdown
Contributor Author

Replaced by #173

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants