Skip to content

Conversation

@aryan9600
Copy link
Member

@aryan9600 aryan9600 commented Nov 8, 2022

Refactors the bootstrap process to use https://github.com/fluxcd/pkg/tree/main/git/gogit, getting rid of the
pkg/bootstrap/git in the process.

Fixes: #3273
Related to: #3282

Signed-off-by: Sanskar Jaiswal [email protected]

@aryan9600 aryan9600 requested review from hiddeco, phillebaba and stefanprodan and removed request for hiddeco and phillebaba November 8, 2022 16:20
@aryan9600
Copy link
Member Author

aryan9600 commented Nov 9, 2022

commands and providers tested:

  • flux bootstrap gitub
  • flux bootstrap gitlab
  • flux bootstrap git with GitHub SSH
  • flux bootstrap git with GitHub HTTPS
  • flux bootstrap git with GitLab SSH
  • flux bootstrap git with GitLab HTTPS
  • flux bootstap git with BitBucket Cloud SSH
  • flux bootstrap git with BitBucket Cloud HTTPS
  • flux bootstrap git with AWS CodeCommit SSH
  • flux bootstrap git with AWS CodeCommit HTTPS
  • flux bootstrap git with Azure Devops SSH
  • flux bootstrap git with Azure Devops HTTPS
  • flux bootstrap git with BitBucket Server SSH
  • flux bootstrap git with BitBucket Server HTTPS
  • flux bootstrap bitbucket-server

@pjbgf pjbgf added the area/git Git related issues and pull requests label Nov 9, 2022
@pjbgf pjbgf added this to the Bootstrap GA milestone Nov 9, 2022
@aryan9600 aryan9600 force-pushed the use-pkg-git branch 2 times, most recently from 3601f85 to 77ff5fd Compare November 9, 2022 12:36
@pjbgf
Copy link
Member

pjbgf commented Nov 9, 2022

Tested the bootstrap with GPG signing, which worked fine in GitHub:
image

@aryan9600 aryan9600 marked this pull request as ready for review November 10, 2022 17:28
@aryan9600 aryan9600 changed the title [WIP] refactor bootstrap process to use fluxcd/pkg/git refactor bootstrap process to use fluxcd/pkg/git Nov 10, 2022
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

Great stuff @aryan9600! 🚀

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @aryan9600 🏅

@stefanprodan stefanprodan added the area/bootstrap Bootstrap related issues and pull requests label Nov 11, 2022
@stefanprodan stefanprodan changed the title refactor bootstrap process to use fluxcd/pkg/git Refactor bootstrap process to use fluxcd/pkg/git Nov 11, 2022
@pjbgf
Copy link
Member

pjbgf commented Nov 14, 2022

@stefanprodan please review the latest changes from an UX PoV. They were required due to the CodeCommit workflow for non --token-auth.

@stefanprodan
Copy link
Member

@aryan9600 @pjbgf I don't understand why is the SSH username a prompt instead of a flag to set it. I also don't understand how and why is this used. Please post an example for AWS CodeCommit to show case what this does.

@stefanprodan
Copy link
Member

stefanprodan commented Nov 14, 2022

I propose we undo the --prompt-ssh-username flag, and tell AWS users to provision a SSH key before bootstrap, then they can simply do:

flux bootstrap git \
--url ssh://SSH-Key-ID@git-codecommit.<region>.amazonaws.com/v1/repos/<repository> \
--private-key-file=<path/to/private.key>

We could add a regex for AWS CodeCommit SSH URLs and error out if the private key is not supplied. We also need to add an example like the above to the command help.

@aryan9600 aryan9600 force-pushed the use-pkg-git branch 2 times, most recently from ac860e6 to 62db2d1 Compare November 15, 2022 09:10
@aryan9600 aryan9600 force-pushed the use-pkg-git branch 3 times, most recently from 5f5bf41 to b5ac7f1 Compare November 17, 2022 04:50
@aryan9600 aryan9600 force-pushed the use-pkg-git branch 2 times, most recently from cfbf96b to 45e10f0 Compare November 17, 2022 11:27
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

Awesome work @aryan9600! 🙇

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Great work 🥇

@pjbgf pjbgf merged commit d4ba6c4 into fluxcd:main Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/bootstrap Bootstrap related issues and pull requests area/git Git related issues and pull requests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Refactor Git operations and introduce go-git support for Azure DevOps and AWS CodeCommit

3 participants