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

chore(github-actions): update contributor and project sync workflows #869

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

aialok
Copy link
Member

@aialok aialok commented Aug 16, 2024

What kind of change does this PR introduce?

  • Since we have branch protection rules, automated commits can't be made. Therefore, both workflows will now create pull requests instead.

Issue Number:

  • None

Screenshots/videos:

If relevant, did you update the documentation?

Summary

Does this PR introduce a breaking change?

@aialok aialok added 🐛 Bug Indicates that the issue is a bug or defect. github_actions Pull requests that update GitHub Actions code labels Aug 16, 2024
@aialok aialok requested a review from a team as a code owner August 16, 2024 21:53
Copy link

github-actions bot commented Aug 16, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview f3ea9d4

Copy link

codecov bot commented Aug 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cc3ce3e) to head (f3ea9d4).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #869   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           20        20           
  Branches        12        12           
=========================================
  Hits            20        20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

Great job with this!

Could it be possible to add another step to approve and another one to merge?

@aialok
Copy link
Member Author

aialok commented Aug 17, 2024

Great job with this!

Could it be possible to add another step to approve and another one to merge?

I don't think it's possible to do this within the same workflow since we need to create the pull request first which take time, then approve it, and finally merge it. But lemme check.

However, it could be easily done with a separate workflow.

@benjagm
Copy link
Collaborator

benjagm commented Aug 17, 2024

However, it could be easily done with a separate workflow.

We'll need to do something to avoid the cumulation of unreviewed PRs.

@aialok
Copy link
Member Author

aialok commented Aug 17, 2024

However, it could be easily done with a separate workflow.

We'll need to do something to avoid the cumulation of unreviewed PRs.

I will be creating another workflow to approve and merge the pr.

@aialok
Copy link
Member Author

aialok commented Aug 17, 2024

Added auto approve and auto merge in the same workflow.

@aialok
Copy link
Member Author

aialok commented Aug 17, 2024

For auto merge, these condition must be true:
image

https://github.com/peter-evans/enable-pull-request-automerge?tab=readme-ov-file#conditions

@gregsdennis
Copy link
Member

Added auto approve and auto merge in the same workflow.

This seems like a bad idea. (Unless I'm misunderstanding what's being added.)

It seems like you're wanting an action to automatically approve and merge PRs? Why? PRs are intended for review... by humans.

@aialok
Copy link
Member Author

aialok commented Aug 17, 2024

Added auto approve and auto merge in the same workflow.

This seems like a bad idea. (Unless I'm misunderstanding what's being added.)

It seems like you're wanting an action to automatically approve and merge PRs? Why? PRs are intended for review... by humans.

Basically, both workflows work to fetch the latest contributor data and our roadmap project data and save it in a file. This allows us to use the data on our website, helping to reduce the number of API calls to GitHub by using the data directly from a JSON file.
There is nothing to review since both are just json file.

And since we have branch protection rule we can't directly push to main branch. We need to create pull request first.

#869 (review)

@gregsdennis
Copy link
Member

And since we have branch protection rule we can't directly push to main branch. We need to create pull request first.

Then maybe this repo isn't the best place to store the results of the data fetch. Maybe we store it in another repo (or a gist) where only the bot has push rights (and maybe the project admins). I use a gist to store some data for a custom badge on my repo (action).

Automation like this seems subversive to me. When I encounter hacks like this, it usually means I've taken a wrong turn somewhere; that I'm doing something wrong.

@benjagm
Copy link
Collaborator

benjagm commented Aug 17, 2024

Automation like this seems subversive to me. When I encounter hacks like this, it usually means I've taken a wrong turn somewhere; that I'm doing something wrong.

Hi everyone here. This is the solution I suggested and I take responsibility. The fetched files will be used to build a future roadmap page and improve the current community page. We are storing the data to avoid doing synchronous API calls and avoid rate limit issues. I understand your concerns and I am happy to discuss alternatives. Gist seems like over-complicating things but I have never implemented it before. I know that AsyncAPI is doing something similar to us in their repository.

@gregsdennis
Copy link
Member

I expect you're looking at something like asyncapi/website#3142?

If that's the direction you want to go, okay. I've given my opinion.

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

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

LGTM

@benjagm benjagm merged commit b11f66f into json-schema-org:main Aug 21, 2024
8 of 9 checks passed
@aialok aialok added the GSoC Google Summer of Code related label Aug 25, 2024
@aialok aialok self-assigned this Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Indicates that the issue is a bug or defect. github_actions Pull requests that update GitHub Actions code GSoC Google Summer of Code related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants