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

feat: verify whether the reported repository can be linked back to the artifact #873

Open
wants to merge 10 commits into
base: staging
Choose a base branch
from

Conversation

mabdollahpour-ol
Copy link
Collaborator

@mabdollahpour-ol mabdollahpour-ol commented Sep 29, 2024

This version has initial support for maven and gradle build tools.

The core part is added as "repo_verifier" under "repo_finder". "analyzer" calls the "repo_verifier" and adds the info to "dynamic_data".
Also added a sample check (for maven) that shows how this data can be used.

@mabdollahpour-ol mabdollahpour-ol self-assigned this Sep 29, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 29, 2024
@mabdollahpour-ol
Copy link
Collaborator Author

The core part is added as "repo_verifier" under "repo_finder".
"analyzer" calls the "repo_verifier" and adds the info to "dynamic_data".
I added a sample check (for maven) that shows how this data can be used.

@behnazh-w
Copy link
Member

The core part is added as "repo_verifier" under "repo_finder". "analyzer" calls the "repo_verifier" and adds the info to "dynamic_data". I added a sample check (for maven) that shows how this data can be used.

Can you please add this information to the PR description?

@mabdollahpour-ol
Copy link
Collaborator Author

@behnazh-w thanks for the comments! I'll apply the changes by EOD.

src/macaron/repo_finder/repo_verifier.py Outdated Show resolved Hide resolved
src/macaron/repo_finder/repo_verifier.py Outdated Show resolved Hide resolved
return True

@staticmethod
def _bfs_walk(root_dir: Path, filename: str) -> Path | None:
Copy link
Member

Choose a reason for hiding this comment

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

You can probably use the get_build_dirs function in build tools. You might just need to improve it to avoid looking into the ["test", "example", "sample", "doc", "demo", "spec", "mock"] directories as implemented in this function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting. Yes, I that's the correct funciton to be used here. Thanks!

Copy link
Collaborator Author

@mabdollahpour-ol mabdollahpour-ol Oct 2, 2024

Choose a reason for hiding this comment

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

I decided to keep this for now (with another name find_file_in_repo under repo_verifier_base) because the amount of refactoring needed to make use of those functions for this purpose seems to be quite high.

Copy link
Member

Choose a reason for hiding this comment

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

OK, no worries. Can you please add a TODO comment to refactor and use get_build_dirs later?

@benmss
Copy link
Member

benmss commented Oct 1, 2024

Is there a plan to add unit testing and integration testing as part of this PR? @behnazh-w

@behnazh-w
Copy link
Member

Is there a plan to add unit testing and integration testing as part of this PR? @behnazh-w

Yes for sure. The PR needs unit tests and integration tests.

@mabdollahpour-ol
Copy link
Collaborator Author

Is there a plan to add unit testing and integration testing as part of this PR? @behnazh-w

Yes for sure. The PR needs unit tests and integration tests.

Yes tests are on the way.

@mabdollahpour-ol mabdollahpour-ol changed the title feat: Verify whether the claimed repository can be linked back to the artifact feat: verify whether the claimed repository can be linked back to the artifact Oct 2, 2024
@mabdollahpour-ol mabdollahpour-ol changed the title feat: verify whether the claimed repository can be linked back to the artifact feat: verify whether the reported repository can be linked back to the artifact Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants