-
Notifications
You must be signed in to change notification settings - Fork 915
[MAINT] Fix github_organization_ruleset and github_repository_ruleset with push target
#2958
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
Open
deiga
wants to merge
52
commits into
integrations:main
Choose a base branch
from
F-Secure-web:org-ruleset-fix-push
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
cbe3621
Update descriptions and validations
deiga 5ebc3d3
Add `CustomizeDiff` logic to validate on `plan`
deiga ae114d7
Remove unused leftover
deiga 7be8666
Add first validation test
deiga edd0c8b
Add validation error when `conditions` is missing
deiga 7a53ffd
Add further validation tests
deiga 9c2ade7
Remove unnecessary skip blocks as `individual` and `anonymous` access…
deiga f6e453b
Switch `ref_name` to `Optional` as `push` doesn't need a `ref_name`
deiga 620ee7e
Add Debug logging with `tflog` to validation
deiga 0187a91
Fix validation as `ref_name`, `repository_name` and `repository_id` a…
deiga 9b14abd
Fix test output expectation
deiga 9c14bb6
Remove unnecessary panic test
deiga 9dafd20
Improve validation output messages
deiga 2dab967
Fix condition to require only one of `repository_name` or `repository…
deiga dd4b1d0
Add validation to `required_workflow.path`
deiga 1a85db2
`make fmt`
deiga 5158315
Rename test resources for easier debugging
deiga 3f2d00f
Fix linter issues
deiga 736cd02
Add validation to ensure `rules.required_status_checks.required_check…
deiga 3d3f8e8
Add test to ensure that `required_checks` is always required
deiga 28c785c
Fix tests after rebase
deiga 27f1582
Improve legibility of `conditions` description
deiga a3ddbd3
Update descriptions
deiga 22dc452
Add Acc test for push ruleset.
deiga 1233fb8
Add failing test for `flattenConditions` with no `ref_name` condition
deiga 77a4c16
Fix `flattenConditions` to work with `push` rulesets
deiga 094409b
Add more tests for `flattenConditions`
deiga c76b1dc
Enable debug logging in `flattenConditions`
deiga 6eb9ea1
Ensures that `flattenConditions` returns an empty list on empty API r…
deiga 036dd6c
Add validation for `push` `rules`
deiga e4134bb
`github_repository`: Remove comment which doesn't hold true anymore
deiga e1ff452
`github_repository`: Ensures that we don't try to PATCH an archived repo
deiga 7d2e899
`github_repository_ruleset`: Change `TestGithubRepositoryRulesetArchi…
deiga f747bf5
Get `TestAccGithubRepositoryRulesets` to work
deiga 804c347
`repository_ruleset`: Add tests for validations
deiga 525e787
`repository_ruleset`: Implement validations for `target`, `conditions…
deiga 7a30bdb
Updated ruleset docs
deiga 1fd5acb
Extract validation functions to separate utils file with unit tests
deiga 6d99fb5
Fix `ExpectError` message
deiga b322f02
Fix push ruleset test config
deiga d7f8863
Remove `repository` target after thorough testing that it doesn't do …
deiga a51779b
Use idiomatic test naming convention
deiga c924617
Address code structure comment in tests
deiga 88154f3
Address import shadowing
deiga 105fb64
Replace unnecessary `fmt.Errorf` with `errors.New`
deiga 27018d2
Fix inconsistent logging
deiga a9b535d
Fix returning wrong `err`
deiga 1fc283d
Refactor to use typed constant string for ruleset `Target`
deiga f217677
Fix indentation issue with `github_repository_file` and heredocs
deiga d51fea0
Refactor `github_repository_file` to use Context-aware functions for …
deiga cd7913d
Rename files to be more sensible
deiga 5c0112b
Refactor validation functions so that Repo and Org share almost every…
deiga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ linters: | |
| - misspell | ||
| - modernize | ||
| - nilerr | ||
| - nilnesserr | ||
| - predeclared | ||
| - staticcheck | ||
| - unconvert | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should sort the returned values based on the inputs which would stop churn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds sensible, need to investigate where the best place for the sorting is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stevehipwell after some investigation, it seems that
schema.TypeSetwould be the correct way to implement unsorted. What do you think?