Skip to content

enhance(build)!: add fork field for OIDC#1221

Merged
ecrupper merged 3 commits intomainfrom
enhance/fork-field
Nov 20, 2024
Merged

enhance(build)!: add fork field for OIDC#1221
ecrupper merged 3 commits intomainfrom
enhance/fork-field

Conversation

@ecrupper
Copy link
Copy Markdown
Contributor

@ecrupper ecrupper commented Nov 7, 2024

Extra context from OIDC proposal: go-vela/community#976 (comment)

This will allow for stricter policies when considering PR builds and their ability to leverage OIDC.

@ecrupper ecrupper requested a review from a team as a code owner November 7, 2024 18:17
@ecrupper ecrupper changed the title enhance(build): add fork field for OIDC enhance(build)!: add fork field for OIDC Nov 7, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 87.09677% with 4 lines in your changes missing coverage. Please review.

Project coverage is 56.89%. Comparing base (9a4003b) to head (7cfad66).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/token/mint.go 0.00% 2 Missing ⚠️
api/oi_config.go 0.00% 1 Missing ⚠️
api/webhook/post.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1221      +/-   ##
==========================================
+ Coverage   56.87%   56.89%   +0.01%     
==========================================
  Files         599      599              
  Lines       32869    32886      +17     
==========================================
+ Hits        18695    18709      +14     
- Misses      13538    13541       +3     
  Partials      636      636              
Files with missing lines Coverage Δ
api/types/build.go 98.61% <100.00%> (+0.03%) ⬆️
database/build/clean.go 100.00% <100.00%> (ø)
database/build/table.go 100.00% <ø> (ø)
database/testutils/api_resources.go 94.81% <100.00%> (+0.01%) ⬆️
database/types/build.go 98.34% <100.00%> (+0.01%) ⬆️
internal/webhook.go 100.00% <ø> (ø)
mock/server/build.go 0.00% <ø> (ø)
scm/github/webhook.go 90.06% <100.00%> (-0.03%) ⬇️
api/oi_config.go 0.00% <0.00%> (ø)
api/webhook/post.go 0.00% <0.00%> (ø)
... and 1 more
---- 🚨 Try these New Features:

envs["VELA_PULL_REQUEST"] = number
envs["VELA_PULL_REQUEST_SOURCE"] = b.GetHeadRef()
envs["VELA_PULL_REQUEST_TARGET"] = b.GetBaseRef()
envs["VELA_PULL_REQUEST_FORK"] = ToString(b.GetFork())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this info attached to pull requests only? or can we do VELA_REPO_FORK and report it on non-PR events too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the only event that can be triggered on the main repo by content pushed to a fork of that repo is via the PR event. GitHub definitely has metadata about if the repo is a fork, but the only time that really matters is when it's attempting to trigger a build on the parent repo right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ohhh i understand what you mean, yeah i get it. sweet

@ecrupper ecrupper merged commit 21761c9 into main Nov 20, 2024
@ecrupper ecrupper deleted the enhance/fork-field branch November 20, 2024 14:50
timhuynh94 pushed a commit that referenced this pull request Dec 12, 2024
* enhance(build): add fork field for OIDC

* fix test

* integration test update
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.

3 participants