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

Create a report of Youtube API keys usage #855

Merged
merged 3 commits into from
Oct 30, 2023
Merged

Create a report of Youtube API keys usage #855

merged 3 commits into from
Oct 30, 2023

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented Oct 26, 2023

Fix #854

  • Add a new maintenance script "report_youtube_api_keys.py" and its companion files (configuration + template)
    • This script will be launched once per month as a cronjob on our k8s cluster
  • Configuration file provided is more a sample / helper for debugging
    • In k8s, this file will be provided by a config map for easier update
  • Template is used to generate the body of the GITHUB issue
  • Environment variables needed:
    • POSTGRES_URI: URI of the database (including DB API, host, username, password, database)
    • GITHUB_TOKEN: a PAT with at least "repo:public_repo" scope
    • CREATE_ISSUE: must be equal to "true" (case insensitive) for the Github Issue to be created, otherwise report is only displayed on StdOut
    • GITHUB_REPO: repository where issue will be created, e.g. openzim/zim-requests
    • GITHUB_ISSUE_ASSIGNEES: a comma separated list of assignees for issue
    • GITHUB_ISSUE_LABELS: a comma separated list of labels for issue

@benoit74 benoit74 self-assigned this Oct 26, 2023
@benoit74 benoit74 force-pushed the list_api_keys branch 3 times, most recently from e1c626f to db5de39 Compare October 27, 2023 09:33
@benoit74 benoit74 changed the title WIP: Create a report of Youtube API keys usage Create a report of Youtube API keys usage Oct 27, 2023
@benoit74 benoit74 requested a review from rgaudin October 27, 2023 09:45
@benoit74 benoit74 marked this pull request as ready for review October 27, 2023 09:45
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

LGTM

@benoit74
Copy link
Collaborator Author

I updated code following review comment + I enhanced code to not request Github environment variables when not needed because we do not create the issue, please review again (it will be quick I hope)

@benoit74 benoit74 requested a review from rgaudin October 30, 2023 07:29
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

Good

@rgaudin rgaudin merged commit aa387e3 into main Oct 30, 2023
5 checks passed
@rgaudin rgaudin deleted the list_api_keys branch October 30, 2023 09:13
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.

Provide a monthly report of youtube API keys
2 participants