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

fix:failed to edit repo #1281

Closed
wants to merge 1 commit into from
Closed

fix:failed to edit repo #1281

wants to merge 1 commit into from

Conversation

neolynx
Copy link
Member

@neolynx neolynx commented Apr 20, 2024

return when the repo cant be found and err !=nil

Replaces #1093

Requirements

All new code should be covered with tests, documentation should be updated. CI should pass.

Description of the Change

Checklist

  • unit-test added (if change is algorithm)
  • functional test added/updated (if change is functional)
  • man page updated (if applicable)
  • bash completion updated (if applicable)
  • documentation updated
  • author name in AUTHORS

@neolynx neolynx added the fix tests Tests are failing label Apr 20, 2024
Copy link

codecov bot commented Apr 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 74.81%. Comparing base (8d09c20) to head (094d358).
Report is 1 commits behind head on master.

Files Patch % Lines
api/repos.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1281      +/-   ##
==========================================
+ Coverage   74.79%   74.81%   +0.02%     
==========================================
  Files         144      144              
  Lines       16256    16248       -8     
==========================================
- Hits        12158    12156       -2     
+ Misses       3156     3152       -4     
+ Partials      942      940       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@neolynx neolynx added increase coverage The PR lacks test coverage and removed fix tests Tests are failing labels Apr 21, 2024
return when  the repo cant be found and err !=nil
if err == nil {
// already exists
if err != nil {
// repo does not exist
Copy link

@mfolusiak mfolusiak May 9, 2024

Choose a reason for hiding this comment

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

Some description to the PR is needed. What is the intention here?
Why do we raise error if *b.Name doesn't exist? If we want to handle cloning(?) of the repo from :name to *b.Name the second one should not exist imo

Choose a reason for hiding this comment

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

I just saw similar doubt has been expressed by @randombenj in the original PR #1093 (comment)
I suggest to close both PRs without merging if this comment is not addressed

Copy link
Member Author

Choose a reason for hiding this comment

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

to me, this looks like as follows:

  • edit repo "A" and set name to "B"
  • if no repo "A" exists, abort (line 111)
  • if new name is set (line 116)
  • check if repo with new "B" name already exists (line 117)
  • if yes (line 118: if err == nil), abort, because we cannot rename to an existing repo

therefore, the patch makes no sense, it incorrectly aborts when getting the repo "B" does return an error (err != nil) and the "repo does not exist.

I agree to drop the PR.

@neolynx neolynx closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
increase coverage The PR lacks test coverage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants