Skip to content
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

enhance(api/scm)!: return affected repos in API response and do not assume 404 on GetRepo error #1015

Merged
merged 4 commits into from
Nov 28, 2023

Conversation

ecrupper
Copy link
Contributor

Particularly helpful when syncing repositories is knowing if anything actually changed with the database object. This change has the API response return any affected repo in its response. Otherwise, if nothing changed, it will return a 204 - No Content.

Also fixed an issue where any error resulting from the SCM call to GetRepo was interpreted as a 404 error. That is not always true.

@ecrupper ecrupper requested a review from a team as a code owner November 28, 2023 15:42
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Merging #1015 (d508a22) into main (6390b12) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1015   +/-   ##
=======================================
  Coverage   68.36%   68.36%           
=======================================
  Files         317      317           
  Lines       13640    13641    +1     
=======================================
+ Hits         9325     9326    +1     
  Misses       3848     3848           
  Partials      467      467           
Files Coverage Δ
scm/github/repo.go 77.10% <100.00%> (+0.05%) ⬆️

Copy link
Member

@wass3rw3rk wass3rw3rk left a comment

Choose a reason for hiding this comment

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

does that mean the repo sync endpoint could return 204 as well? do we need to lift the response codes the github api can return to our api spec comments in this section: https://github.com/go-vela/server/pull/1015/files#diff-ccd33b844d96fe96ea644179c0ac423c805dc392a9e24117a60d2b269721eb9aL40

@ecrupper ecrupper merged commit 2b58510 into main Nov 28, 2023
11 of 12 checks passed
@ecrupper ecrupper deleted the fix/api/scm-sync-error-handling branch November 28, 2023 21:50
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.

5 participants