Skip to content

feat(ci): dispatch GitHub analytics action #2161

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

Merged
merged 10 commits into from
Apr 24, 2023
Merged

Conversation

rubenfonseca
Copy link
Contributor

@rubenfonseca rubenfonseca commented Apr 24, 2023

Issue number: #2160

Summary

Changes

Please provide a summary of what's being changed

This PR adds a new GitHub action that runs every hour. The action assumes an OIDC role and calls a Lambda Function that dispatches all the crawling functions synchronously.

User experience

Please share what the user experience looks like before and after this change

After this change, we should see fresh analytics every hour.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@rubenfonseca rubenfonseca requested a review from a team as a code owner April 24, 2023 16:02
@rubenfonseca rubenfonseca requested review from leandrodamascena and removed request for a team April 24, 2023 16:02
@boring-cyborg boring-cyborg bot added github-actions Pull requests that update Github_actions code tests labels Apr 24, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 24, 2023
@rubenfonseca rubenfonseca linked an issue Apr 24, 2023 that may be closed by this pull request
2 tasks
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

Two tiny changes. fantastic work, Ruben!

It's quite a genius move to do this and cut down all the infra required to exchange tokens and whatnot per repo

repository-projects: read
security-events: read
statuses: read

jobs:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we run in an environment do secrets are encrypted from forks?

You never know if we ever accidentally make a mistake in the IAM OIDC and allow any repo. This will prevent this attack vector.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, created a new "analytics" environment and moved the secrets there. I've removed the old secrets too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please note that the IAM OIDC would not be assumable since there's a condition to only be assumable by this repository too. In any case, it's better this way.

@github-actions github-actions bot added the feature New feature or functionality label Apr 24, 2023
@heitorlessa heitorlessa merged commit 625b40a into develop Apr 24, 2023
@heitorlessa heitorlessa deleted the rf/analytics-dispatch branch April 24, 2023 19:25
@dreamorosi
Copy link
Contributor

Hey folks, do we need something like this in the TS repo?

@rubenfonseca
Copy link
Contributor Author

rubenfonseca commented Apr 25, 2023

@dreamorosi yes Andrea, I will send instructions and open PR for the rest of the runtimes during the day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality github-actions Pull requests that update Github_actions code size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: Add a GitHub analytics dispatcher
3 participants