Skip to content

fix(gitea): add src as context for gitea status updates - #5975

Merged
jamengual merged 3 commits into
runatlantis:mainfrom
maddawik:patch-1
Mar 26, 2026
Merged

fix(gitea): add src as context for gitea status updates#5975
jamengual merged 3 commits into
runatlantis:mainfrom
maddawik:patch-1

Conversation

@maddawik

@maddawik maddawik commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

what

Updates the GiteaClient.UpdateStatus method so that src (which should be atlantis/plan or atlantis/apply afaict) is passed as the Context for the gitea.CreateStatusOption struct. This should give status checks names which can be seen in the UI and pattern matched against. This seems like how the other clients are passing the status name along as well.

why

This should make it possible for status checks to be pattern matched in branch protection rules. i.e. atlantis/plan and atlantis/apply could be explicitly required before merge.

tests

I don't see any related tests for the client though this is my first PR, so if I'm missing something I'm happy to address it.

Edit: I tested this locally

Before patch

Status updates have no name, a branch protection rule that has atlantis/* means nothing in this context (see screenshot)

Screenshot 2025-11-23 at 1 03 16 AM

After patch

I built the patched version locally and re-ran a test, seeing context appear and able to assert branch protection rules. I think this was as simple as it seemed!

Screenshot 2025-11-23 at 12 53 07 AM Screenshot 2025-11-23 at 12 57 09 AM

references

Closes #5802

@dosubot dosubot Bot added bug Something isn't working go Pull requests that update Go code labels Nov 21, 2025
@github-actions github-actions Bot removed the bug Something isn't working label Nov 21, 2025
@maddawik
maddawik force-pushed the patch-1 branch 4 times, most recently from cbf9616 to d799630 Compare December 1, 2025 16:56
Copilot AI review requested due to automatic review settings February 14, 2026 03:35

Copilot AI left a comment

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.

Pull request overview

This PR fixes a bug in the Gitea VCS client where commit status updates were missing the context identifier. Without setting the Context field in the CreateStatusOption struct, Gitea status checks appear with no name in the UI, making them unusable for branch protection rules. The fix aligns Gitea's implementation with all other VCS providers (GitHub, GitLab, Azure DevOps, Bitbucket) which already pass the src parameter (e.g., "atlantis/plan", "atlantis/apply") as the context/key field.

Changes:

  • Added the Context field to gitea.CreateStatusOption struct, passing the src parameter to properly identify status checks

@maddawik

Copy link
Copy Markdown
Contributor Author

Hey @lukemassa , any chance this could make it in? It would be great to not have to patch it myself if possible. Thanks for your time!

@lukemassa lukemassa left a comment

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.

LGTM!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Feb 14, 2026
This makes it possible for status checks to be pattern matched in branch
protection rules. i.e. `atlantis/plan` and `atlantis/apply` could be required.

Signed-off-by: maddawik <edwardreillycomputers@gmail.com>
@jamengual

Copy link
Copy Markdown
Contributor

Thanks @maddawik for the contribution

@jamengual
jamengual merged commit 0ad6fc0 into runatlantis:main Mar 26, 2026
39 checks passed
@maddawik
maddawik deleted the patch-1 branch March 26, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gitea commit status is missing status id

4 participants