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 Webhook for Repository ruleset #3305

Merged
merged 43 commits into from
Oct 16, 2024

Conversation

unamdev0
Copy link
Contributor

@unamdev0 unamdev0 commented Oct 4, 2024

Added Repository ruleset event
Fixes #3295

@unamdev0
Copy link
Contributor Author

unamdev0 commented Oct 4, 2024

@gmlewis please ignore the previous PR and review this. This PR contains just my code and hasn't been reabased with master branch.
updated RuleSet to Ruleset everywhere, also improved the comment describing the repository ruleset event

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

I'm going to hold off reviewing this one until comments from the last PR are addressed.
Specifically,

Godocs should always use complete sentences with punctuation so that the auto-generated package documentation formats and reads nicely.

It looks like GitHub ate my other lengthy comment, unfortunately... but the gist of it was that every exported struct needs a Godoc-style comment to explain its purpose and usage for the auto-generated package documentation.

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.39%. Comparing base (2b8c7fa) to head (e125889).
Report is 154 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3305      +/-   ##
==========================================
- Coverage   97.72%   93.39%   -4.33%     
==========================================
  Files         153      172      +19     
  Lines       13390    11909    -1481     
==========================================
- Hits        13085    11123    -1962     
- Misses        215      692     +477     
- Partials       90       94       +4     

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

@unamdev0
Copy link
Contributor Author

unamdev0 commented Oct 4, 2024

I'm going to hold off reviewing this one until comments from the last PR are addressed.
Specifically,

Godocs should always use complete sentences with punctuation so that the auto-generated package documentation formats and reads nicely.

It looks like GitHub ate my other lengthy comment, unfortunately... but the gist of it was that every exported struct needs a Godoc-style comment to explain its purpose and usage for the auto-generated package documentation.

Got it, will add comments for every new struct added and will let you know

@unamdev0
Copy link
Contributor Author

@gmlewis please go ahead and review the code, I've added comments for all the new structs generated

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @unamdev0 !
Just a few linter errors to clean up, please, and a few tweaks, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.

github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
@unamdev0
Copy link
Contributor Author

Done @gmlewis, all the suggestion made have been added and test files have been modified accordingly

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

It looks like there are a few more linter errors - you can see them in the GitHub user interface, I believe.

github/repos_rules.go Outdated Show resolved Hide resolved
@gmlewis
Copy link
Collaborator

gmlewis commented Oct 14, 2024

You should also be able to see them locally if you follow step 4 of CONTRIBUTING.md.

@unamdev0
Copy link
Contributor Author

Hi @gmlewis, I'm not able to see any linting issues shown in github interface, when running script/lint.sh. Other than that,I've made the change that was missed last time

Screenshot 2024-10-14 at 8 50 40 PM

@gmlewis
Copy link
Collaborator

gmlewis commented Oct 14, 2024

Ah, to see them locally you probably need to merge the latest master into your PR... but I'll rerun the workflows and see if I can take screenshots for you.

@gmlewis
Copy link
Collaborator

gmlewis commented Oct 14, 2024

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

I've gone ahead and made suggestions that should clear up the linter errors.

github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
@unamdev0
Copy link
Contributor Author

@gmlewis added the suggestions, should I add the changes in generated files manually as well as shown in the github UI?

@gmlewis
Copy link
Collaborator

gmlewis commented Oct 14, 2024

@gmlewis added the suggestions, should I add the changes in generated files manually as well as shown in the github UI?

No, you should never edit the auto-generated files. If you find problems in them (which I don't think there are any), then the code that generates them gen-*.go should be modified... but usually, users of this repo can leave maintenance of those up to the maintainers of the repo. Is that what you were asking?

@gmlewis
Copy link
Collaborator

gmlewis commented Oct 14, 2024

Can you please push those changes to the suggested changes? I'm not seeing them yet.

@unamdev0
Copy link
Contributor Author

No, you should never edit the auto-generated files. If you find problems in them (which I don't think there are any), then the code that generates them gen-*.go should be modified... but usually, users of this repo can leave maintenance of those up to the maintainers of the repo. Is that what you were asking?

Oh okay, I've pushed changes with period at the end of comments, and not modified any other file, can you please review once

github/repos_rules.go Outdated Show resolved Hide resolved
github/event_types_test.go Show resolved Hide resolved
gmlewis and others added 2 commits October 15, 2024 16:04
Co-authored-by: Oleksandr Redko <[email protected]>
Co-authored-by: Oleksandr Redko <[email protected]>
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

I'll go ahead and apply these as well.

github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 15, 2024
@gmlewis
Copy link
Collaborator

gmlewis commented Oct 15, 2024

Bummer. I didn't get the spacing right. working on it...

github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
@gmlewis
Copy link
Collaborator

gmlewis commented Oct 15, 2024

@unamdev0 - sorry for all the noise - I was trying to make it so that we wouldn't require more changes from you, but alas I was unsuccessful.

Could you please do this for me again?

git checkout feature/add-repositoryrulesetevent
git pull origin feature/add-repositoryrulesetevent
go generate ./...
git commit -am 'Run latest go generate'
git push origin feature/add-repositoryrulesetevent

@unamdev0
Copy link
Contributor Author

done @gmlewis

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Unit tests still failing. I'll see if I can fix them.

github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
github/event_types_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Merging.

@gmlewis gmlewis merged commit b93ab91 into google:master Oct 16, 2024
6 of 7 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
Development

Successfully merging this pull request may close these issues.

Feature: repository ruleset event type not defined
3 participants