-
Notifications
You must be signed in to change notification settings - Fork 14
feat(risk): add GitLab support for risk assessment tier scripts #981
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
Draft
maruiz93
wants to merge
18
commits into
fullsend-ai:main
Choose a base branch
from
maruiz93:922-risk-assessment-gitlab
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.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1639704
feat(risk): add Tier 1 metadata signal script and unit tests
maruiz93 ffaedf4
feat(risk): add scoring skill and sub-agent definition
maruiz93 a9b4693
feat(risk): add schema, env flag, and orchestrator integration
maruiz93 e0596c4
feat(risk): add risk label and sticky comment to post-review
maruiz93 0054ecc
test(risk): add functional eval cases for risk assessment
maruiz93 55d198c
fix(risk): use mapfile for file list parsing and fix dispatch note wo…
maruiz93 9e9f0aa
fix(risk): address review findings from fullsend and qodo bots
maruiz93 ef21639
fix: narrow has_ci_files to workflow/action paths only
maruiz93 60e8e20
fix: use established REPO_DIR pattern for clone-deepening
maruiz93 b1e3af1
fix: enforce score/level consistency in risk_assessment schema
maruiz93 5c33931
fix: remove redundant requirements.txt literal from dependency patterns
maruiz93 52d5ac6
fix: simplify author signal parsing and add pagination test
maruiz93 beb0c4b
fix: address review findings — test pattern, eval labels, post-review…
maruiz93 889c073
fix: apply risk labels before review submission
maruiz93 17b0e00
fix: address low-severity review findings
maruiz93 36a205f
fix(risk): address review findings from fullsend and qodo bots
maruiz93 a06a0a7
feat(risk): add GitLab support for risk assessment tier scripts
maruiz93 f00ffcb
fix(risk): address review findings — sanitize warnings, fix token fal…
maruiz93 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
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
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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| state: open | ||
|
|
||
| labels: | ||
| required: [] | ||
| forbidden: | ||
| - risk/elevated | ||
| - risk/high | ||
| - risk/critical | ||
| - ready-for-merge | ||
| risk_label_required: true | ||
|
|
||
| max_turns: 60 | ||
| max_cost_usd: 5.00 | ||
|
|
||
| review_expectations: | | ||
| Two-file change: a README typo fix and a basic CODEOWNERS file. | ||
| Risk assessment should produce a low (1) or moderate (2) score. | ||
| The .github/CODEOWNERS file is a protected path, which raises the | ||
| PROTECTED_PATH_COUNT signal — this legitimately nudges the score | ||
| toward moderate. Either risk/low or risk/moderate is acceptable; | ||
| elevated or higher would be a misclassification. | ||
|
|
||
| The PR touches .github/CODEOWNERS (a protected path), so | ||
| post-review.sh downgrades an approve to comment — same mechanism | ||
| as case 003. This avoids the 422 self-review error that blocks | ||
| label application. The ready-for-merge label is forbidden because | ||
| the protected-path downgrade always yields requires-manual-review. |
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| forge: github | ||
| fixture: | ||
| type: pull_request | ||
| title: "docs: fix typo in README and add CODEOWNERS" | ||
| body: | | ||
| Fixes a minor typo in the project README and adds a basic | ||
| CODEOWNERS file for repository governance. | ||
| base: main | ||
| files: | ||
| - path: README.md | ||
| content: | | ||
| # Test Project | ||
|
|
||
| This is a test project for evaluating the review agent. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| Run `make build` to compile the project. | ||
| - path: .github/CODEOWNERS | ||
| content: | | ||
| # Default ownership | ||
| * @test-org/maintainers |
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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Test Project | ||
|
|
||
| This is a test project for evaluating the review agent. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| Run `make biuld` to compile the project. |
23 changes: 23 additions & 0 deletions
23
eval/review/cases/002-risk-high-auth-change/annotations.yaml
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 |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| state: open | ||
|
|
||
| labels: | ||
| required: [] | ||
| forbidden: | ||
| - risk/low | ||
| - ready-for-merge | ||
| risk_label_required: true | ||
|
|
||
| max_turns: 80 | ||
| max_cost_usd: 8.00 | ||
|
|
||
| review_expectations: | | ||
| Multi-file auth refactor touching RBAC, CODEOWNERS, and security- | ||
| sensitive paths. Risk assessment should produce a moderate or higher | ||
| score (2+) due to security-sensitive path signals. The risk/low | ||
| label is forbidden to guard against misclassification. | ||
|
|
||
| The PR touches CODEOWNERS (a protected path). If the agent | ||
| approves, post-review.sh downgrades the approval to comment, | ||
| avoiding the 422 self-review error. The ready-for-merge label is | ||
| forbidden because the protected-path downgrade always yields | ||
| requires-manual-review. |
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 |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| forge: github | ||
| fixture: | ||
| type: pull_request | ||
| title: "refactor: restructure auth middleware" | ||
| body: | | ||
| Refactors the authentication middleware to support multiple auth | ||
| providers. Touches RBAC policy evaluation and token validation. | ||
|
|
||
| Closes #42 | ||
| base: main | ||
| files: | ||
| - path: internal/auth/handler.go | ||
| content: | | ||
| package auth | ||
|
|
||
| import ( | ||
| "context" | ||
| "net/http" | ||
| ) | ||
|
|
||
| // Handler validates requests against the configured auth provider. | ||
| func Handler(provider string) func(http.Handler) http.Handler { | ||
| return func(next http.Handler) http.Handler { | ||
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| token := r.Header.Get("Authorization") | ||
| if token == "" { | ||
| http.Error(w, "unauthorized", http.StatusUnauthorized) | ||
| return | ||
| } | ||
| if !validateToken(r.Context(), token, provider) { | ||
| http.Error(w, "forbidden", http.StatusForbidden) | ||
| return | ||
| } | ||
| next.ServeHTTP(w, r) | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| func validateToken(ctx context.Context, token, provider string) bool { | ||
| switch provider { | ||
| case "oidc": | ||
| _, err := oidcVerifier.Verify(ctx, token) | ||
| return err == nil | ||
| case "static": | ||
| return constantTimeEqual(token, staticToken) | ||
| default: | ||
| return false | ||
| } | ||
| } | ||
| - path: internal/auth/rbac.go | ||
| content: | | ||
| package auth | ||
|
|
||
| // CheckPermission verifies the user has the required role. | ||
| func CheckPermission(userRoles []string, required string) bool { | ||
| for _, role := range userRoles { | ||
| if role == required || role == "admin" { | ||
| return true | ||
| } | ||
| } | ||
| return false | ||
| } | ||
| - path: CODEOWNERS | ||
| content: | | ||
| internal/auth/ @security-team |
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Auth Service | ||
|
|
||
| Authentication and authorization middleware. |
15 changes: 15 additions & 0 deletions
15
eval/review/cases/002-risk-high-auth-change/repo/internal/auth/handler.go
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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package auth | ||
|
|
||
| import "net/http" | ||
|
|
||
| // Handler validates requests using a static token. | ||
| func Handler(next http.Handler) http.Handler { | ||
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| token := r.Header.Get("Authorization") | ||
| if token != "valid-token" { | ||
| http.Error(w, "unauthorized", http.StatusUnauthorized) | ||
| return | ||
| } | ||
| next.ServeHTTP(w, r) | ||
| }) | ||
| } |
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.