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 a download counter for legacy roles. #1719

Merged
merged 1 commit into from
May 18, 2023

Conversation

jctanner
Copy link
Contributor

@jctanner jctanner commented May 15, 2023

Use the same logic from galaxy's old codebase for determining a download is happening, which was "if the roles list view is called and the url contains parameters for owner__username and name, assume it's the CLI getting the details it needs to create the repo url and clone|download the role".

Use a simple integer field instead of a table that could grow to a very large size. The previous implementation incremented a counter on the [github] repository foreign key, which isn't part of the v1 rewrite.

Copy the old download_count when syncing v1 roles.

https://github.com/ansible/galaxy/blob/devel/galaxy/api/views/roles.py#L46-L63

Issue: AAH-2238

@netlify
Copy link

netlify bot commented May 15, 2023

Deploy Preview for galaxyng canceled.

Name Link
🔨 Latest commit 1a97e4d
🔍 Latest deploy log https://app.netlify.com/sites/galaxyng/deploys/64664c8cc543ff00073519bd

@github-actions github-actions bot added backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) labels May 15, 2023
@jctanner jctanner removed backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) labels May 15, 2023
@jctanner jctanner changed the title Add a download for counter for legacy roles. Add a download counter for legacy roles. May 15, 2023
@jctanner jctanner force-pushed the ROLE_DOWNLOAD_COUNTS branch 3 times, most recently from 01a07d4 to d8c4022 Compare May 18, 2023 15:58
* Use the same logic from galaxy's old codebase for determining a role download is happening.
* Use a simple integer field instead of a table that could grow to a very large size.

Issue: AAH-2238

Signed-off-by: James Tanner <tanner.jc@gmail.com>
@jctanner jctanner merged commit dbce111 into ansible:master May 18, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants