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

EXT-282-follow-project #745

Merged
merged 4 commits into from
Jul 4, 2022
Merged

EXT-282-follow-project #745

merged 4 commits into from
Jul 4, 2022

Conversation

corinnesollows
Copy link
Contributor

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Changes

Added a warning in the error for Follow command that only Github and Bitbucket are supported at this time
Further commenting and formatting on the follow.go file

Rationale

We are no longer supporting the 'follow' command going forward, but we do not wish to remove the legacy functionality

Screenshots

image

@corinnesollows corinnesollows requested a review from a team as a code owner July 4, 2022 13:40
fmt.Println("Unable to determine project slug for CircleCI (slug is case sensitive).")
}
//check that project url contains github or bitbucket; our legacy vcs
if remote.VcsType == git.GitHub || remote.VcsType == git.Bitbucket {
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed there's similar logic in cmd/open.go. Would it make sense to add an isLegacyVcs method to the Remote struct in git/git.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That also would definitely work. While I was writing this I was under the assumption that it was part of an external package. That being said, I dont know if its worth going back and changing, since these are most likely going to be the only two places using this and we're looking to eventually get rid of VCSType completely.


return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might need an else clause here otherwise the conditions on lines 36 and 38 would print messages and then print an error

Suggested change
}
return nil
} else {
//if not warn user their vcs is not supported
return errors.New(errorMessage)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, added

cmd/follow.go Outdated
//check that project url contains github or bitbucket; our legacy vcs
if remote.VcsType == git.GitHub || remote.VcsType == git.Bitbucket {
vcsShort := "gh"
if remote.VcsType == "BITBUCKET" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if remote.VcsType == "BITBUCKET" {
if remote.VcsType == git.Bitbucket {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure I'll change this, I did not write it however :)

Copy link
Contributor

@joeyorlando joeyorlando left a comment

Choose a reason for hiding this comment

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

overall LGTM, just some small suggestions/questions

@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #745 (55bf1f9) into master (f3c1720) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #745      +/-   ##
==========================================
- Coverage   31.79%   31.78%   -0.02%     
==========================================
  Files          44       44              
  Lines        5324     5327       +3     
==========================================
  Hits         1693     1693              
- Misses       3381     3384       +3     
  Partials      250      250              
Impacted Files Coverage Δ
cmd/follow.go 25.00% <0.00%> (-3.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3c1720...55bf1f9. Read the comment docs.

@corinnesollows corinnesollows merged commit 25ac45c into master Jul 4, 2022
@corinnesollows corinnesollows deleted the EXT-282-follow-project branch July 4, 2022 14:47
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.

2 participants