-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 branch_filter
to hooks API endpoints
#26599
Conversation
We now include the branch filler in the response. Signed-off-by: Yarden Shoham <git@yardenshoham.com>
2fb89c8
to
287578d
Compare
modules/structs/hook.go
Outdated
@@ -19,6 +19,7 @@ var ErrInvalidReceiveHook = errors.New("Invalid JSON payload received over webho | |||
type Hook struct { | |||
ID int64 `json:"id"` | |||
Type string `json:"type"` | |||
BranchFilter string `json:"branch_filter" binding:"GlobPattern"` |
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.
What is binding:"GlobPattern"
?
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 don't know, I just copied from
Line 48 in 79c3329
BranchFilter string `json:"branch_filter" binding:"GlobPattern"` |
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 do not think it's right to merge "don't know" code into code base. Every line of code should have clear meaning.
I removed the unknown code |
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.
Actually I would suggest to figure out every line's detail by some in-depth research when a question comes, it makes people more familiar with the code base and framework 😄
The binding
tag is a framework mechanism, to help to "bind" user input to a value field, so it is only needed when using the binding framework to process user inputs.
We now include the branch filler in the response. - Closes go-gitea#26591 # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/73933940-c1a7-4573-abae-f340b63028b2) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/3b3c4a85-0f7c-48c7-8617-def7a66c671d) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
Backport #26599 by @yardenshoham We now include the branch filler in the response. - Closes #26591 Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Yarden Shoham <git@yardenshoham.com>
* giteaofficial/main: (21 commits) Update minimum password length requirements (go-gitea#25946) cynkra is covered via oc links now (go-gitea#26641) update config docs url (go-gitea#26640) devpod use go1.21 (go-gitea#26637) Use correct minio error (go-gitea#26634) Remove avatarHTML from template helpers (go-gitea#26598) Add optimistic lock to ActionRun table (go-gitea#26563) Improve the branch selector tab UI (go-gitea#26631) Improve translation of milestone filters (go-gitea#26569) Add `branch_filter` to hooks API endpoints (go-gitea#26599) Replace box-shadow for `floating` dropdown as well (go-gitea#26581) Add link to job details and tooltip to commit status in repo list in dashboard (go-gitea#26326) Ignore the trailing slashes when comparing oauth2 redirect_uri (go-gitea#26597) Update tool dependencies (go-gitea#26607) bump go to 1.21 (go-gitea#26608) Update 1.20.3 changelog (go-gitea#26609) Fix NPM packages name validation (go-gitea#26595) Use "input" event instead of "keyup" event for migration form (go-gitea#26602) Do not use deprecated log config options by default (go-gitea#26592) fix reopen logic for agit flow pull request (go-gitea#26399) ...
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [docker.io/gitea/gitea](https://github.com/go-gitea/gitea) | patch | `1.20.3` -> `1.20.4` | --- ### Release Notes <details> <summary>go-gitea/gitea (docker.io/gitea/gitea)</summary> ### [`v1.20.4`](https://github.com/go-gitea/gitea/blob/HEAD/CHANGELOG.md#1204---2023-09-08) [Compare Source](go-gitea/gitea@v1.20.3...v1.20.4) - SECURITY - Check blocklist for emails when adding them to account ([#​26812](go-gitea/gitea#26812)) ([#​26831](go-gitea/gitea#26831)) - ENHANCEMENTS - Add `branch_filter` to hooks API endpoints ([#​26599](go-gitea/gitea#26599)) ([#​26632](go-gitea/gitea#26632)) - Fix incorrect "tabindex" attributes ([#​26733](go-gitea/gitea#26733)) ([#​26734](go-gitea/gitea#26734)) - Use line-height: normal by default ([#​26635](go-gitea/gitea#26635)) ([#​26708](go-gitea/gitea#26708)) - Fix unable to display individual-level project ([#​26198](go-gitea/gitea#26198)) ([#​26636](go-gitea/gitea#26636)) - BUGFIXES - Fix wrong review requested number ([#​26784](go-gitea/gitea#26784)) ([#​26880](go-gitea/gitea#26880)) - Avoid double-unescaping of form value ([#​26853](go-gitea/gitea#26853)) ([#​26863](go-gitea/gitea#26863)) - Redirect from `{repo}/issues/new` to `{repo}/issues/new/choose` when blank issues are disabled ([#​26813](go-gitea/gitea#26813)) ([#​26847](go-gitea/gitea#26847)) - Sync tags when adopting repos ([#​26816](go-gitea/gitea#26816)) ([#​26834](go-gitea/gitea#26834)) - Fix verifyCommits error when push a new branch ([#​26664](go-gitea/gitea#26664)) ([#​26810](go-gitea/gitea#26810)) - Include the GITHUB_TOKEN/GITEA_TOKEN secret for fork pull requests ([#​26759](go-gitea/gitea#26759)) ([#​26806](go-gitea/gitea#26806)) - Fix some slice append usages ([#​26778](go-gitea/gitea#26778)) ([#​26798](go-gitea/gitea#26798)) - Add fix incorrect can_create_org_repo for org owner team ([#​26683](go-gitea/gitea#26683)) ([#​26791](go-gitea/gitea#26791)) - Fix bug for ctx usage ([#​26763](go-gitea/gitea#26763)) - Make issue template field template access correct template data ([#​26698](go-gitea/gitea#26698)) ([#​26709](go-gitea/gitea#26709)) - Use correct minio error ([#​26634](go-gitea/gitea#26634)) ([#​26639](go-gitea/gitea#26639)) - Ignore the trailing slashes when comparing oauth2 redirect_uri ([#​26597](go-gitea/gitea#26597)) ([#​26618](go-gitea/gitea#26618)) - Set errwriter for urfave/cli v1 ([#​26616](go-gitea/gitea#26616)) - Fix reopen logic for agit flow pull request ([#​26399](go-gitea/gitea#26399)) ([#​26613](go-gitea/gitea#26613)) - Fix context filter has no effect in dashboard ([#​26695](go-gitea/gitea#26695)) ([#​26811](go-gitea/gitea#26811)) - Fix being unable to use a repo that prohibits accepting PRs as a PR source. ([#​26785](go-gitea/gitea#26785)) ([#​26790](go-gitea/gitea#26790)) - Fix Page Not Found error ([#​26768](go-gitea/gitea#26768)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yMy4yIiwidXBkYXRlZEluVmVyIjoiMzYuMjMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Reviewed-on: https://git.home/nrdufour/home-ops/pulls/79 Co-authored-by: Renovate <renovate@ptinem.io> Co-committed-by: Renovate <renovate@ptinem.io>
We now include the branch filler in the response.
Before
After