Skip to content

Conversation

@saksham23467
Copy link
Contributor

@saksham23467 saksham23467 commented Jul 31, 2025

Description
This PR implements the Clones metric API as defined by CHAOSS. It returns the number of repository clones (both total and unique) for a given repository or repo group, filtered by an optional time range.

Fixes
Fixes #2604

Notes for Reviewers

  • The metric fetches data from the augur_data.repo_clones_data table.
  • It supports filtering via repo_id, repo_group_id, begin_date, and end_date.
  • The logic is consistent with other metric implementations in the codebase.
  • Please verify the SQL query structure and parameter usage.

Signed commits

  • Yes, I signed my commits.

@saksham23467 saksham23467 force-pushed the fix/clones-metric-api branch from 358ab5a to 2cac481 Compare July 31, 2025 12:37
@saksham23467
Copy link
Contributor Author

Hi! This is my first contribution to CHAOSS. Please let me know if any changes are required. Looking forward to your feedback!

Copy link
Contributor

@Ulincsys Ulincsys left a comment

Choose a reason for hiding this comment

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

There are extra changes in this PR that should not be included.

Please rebase and remove the extra changes from each PR, and I can review them independently.


owner, name = get_owner_repo(repo.repo_git)
url = f"https://api.github.com/repos/{owner}/{name}"
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

Your error handling changes were included in this PR, and also #3248

@saksham23467
Copy link
Contributor Author

saksham23467 commented Sep 15, 2025 via email

@sgoggins sgoggins added the add-feature Adds new features label Oct 16, 2025
@MoralCode MoralCode force-pushed the fix/clones-metric-api branch from 5e7c270 to 2cac481 Compare October 16, 2025 20:01
Signed-off-by: saksham23467 <142910439+saksham23467@users.noreply.github.com>
@MoralCode MoralCode force-pushed the fix/clones-metric-api branch from 2cac481 to cd87f5c Compare October 16, 2025 20:04
@sgoggins
Copy link
Member

This has been sitting here for a while and we are going through things ... it does not look like its been tested, and its pretty isolated from our other code ... AND, these metrics are NOT USEFUL UNLESS YOU ARE USING AN API KEY that has maintainer rights on the repos you are getting data for. So, if you are running Augur only on the repos you have those privileges on you will get this data ... most OSPO driven Augur instances will not be able to capture this data.

@sgoggins sgoggins merged commit c5eeb07 into chaoss:main Oct 16, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-feature Adds new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clones metric API

3 participants