-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
GitHub proxy part 6.5: tsh git ssh/clone/config #50044
Conversation
4aeabc8
to
fd571b3
Compare
a5cb9a6
to
97bbddf
Compare
fc0459d
to
0e0f74f
Compare
go.mod
Outdated
@@ -100,6 +100,7 @@ require ( | |||
github.com/fxamacker/cbor/v2 v2.7.0 | |||
github.com/ghodss/yaml v1.0.0 | |||
github.com/gizak/termui/v3 v3.1.0 | |||
github.com/go-git/go-git/v5 v5.12.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go-git
will be used for the teleport
as well.
local mac build tsh
increased about 200k (out of 106MB) after importing it.
0e0f74f
to
f21c24c
Compare
f21c24c
to
9d38794
Compare
🤖 Vercel preview here: https://docs-1vdax8b5f-goteleport.vercel.app/docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some context to the implementation choice, i.e, shelling out to git
binaries versus using go-git
? There are some pros and cons to both and it would be beneficial to hear your reasoning; perhaps worth documenting it in the package itself, too?
On that note, I wonder if we should start splitting the tsh subcommands into their own packages.
We are using git
command line interface as the API, which makes it hard to spot any potential mistakes. We don't have infrastructure for this yet, but having an end-to-end suite of tests (including a real github repo and docker image with git
) would be amazing.
All those shell invocations makes me wonder about Windows. Can you check if tsh.exe
works as intended? (My build command: BUILDDIR=build-win FIDO2=no ARCH=amd64 OS=windows make build-win/tsh && mv build-win/tsh build-win/tsh.exe
)
using
It still relies on
Added to TODO list (#48762).
I think it should work without issue. I will give it a shot later and submit a separate issue to track it if it doesn't work. |
friendly ping @smallinsky @r0mant |
|
||
func (c *gitConfigCommand) run(cf *CLIConf) error { | ||
// Make sure we are in a Git dir. | ||
err := execGitWithStdoutAndStderr(cf, io.Discard, io.Discard, "rev-parse", "--is-inside-work-tree") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --is-inside-work-tree
return true or false:
--is-inside-work-tree
When the current working directory is inside the work tree of the repository print "true", otherwise "false".
Just want to ensure that we want to rely on command error and not handle the "false" case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the false
getting printed:
stevehuang@mac ~ $ git rev-parse --is-inside-work-tree
fatal: not a git repository (or any of the parent directories): .git
The fatal
error is sent to stderr. Same on my mac or my ec2 linux machine.
55f3f8e
to
683d82a
Compare
* GitHub proxy part 6.5: tsh git ssh/clone/config * review comments * fix test * fix ut for lookpath * fix logger and update dependency version * go mod tidy for integrations
* GitHub proxy part 6.5: tsh git ssh/clone/config * review comments * fix test * fix ut for lookpath * fix logger and update dependency version * go mod tidy for integrations
* GitHub Proxy part 1: github integration resource (#48999) * github integration resource * fix lib/web * revert withSecrets * use static credentials * address review comments * fix ut * GitHub Proxy part 2: git_server resource, service, and RBAC (#49393) * git_server resource and role.allow.github_permissions * implicit RO on KindGitServer * review comments * fix ut * make -C integrations/operator crd * fix ut again * make crds-up-to-date and make -C integrations/terraform docs * GitHub proxy part 1.5: integration in web ui (#49561) * GitHub proxy part 1.5: integration in web ui * fix lint * GitHub Proxy part 3.5: caching PluginStaticCredentials (#49472) * GitHub Proxy part 3.5: caching PluginStaticCredentials * fix lint * GitHub proxy part 2.5: git_server cache (#49564) * GitHub proxy part 2.5: git_server cache * revert event * fix getAll * review comments * GitHub Proxy part 3: gen github user cert and export CA (#49396) * GitHub Proxy part 3: gen github user cert and export CA * address pr comment * minor refactor * use cache * fix build and cache * GitHub proxy part 4: `tsh git ls` with unified resource (#49596) * GitHub proxy part 4: tsh git ls * fix ut * update username note * fix * GitHub proxy part 5: OAuth flow to retrieve GitHub identity (#49849) * GitHub proxy part 5: OAuth flow to retrieve GitHub identity * review comments round1 * review comments round 2 and update tsh git list * make -C integrations/operator crd * make -C integrations/terraform docs * fix flaky test * GitHub proxy part 6.5: tsh git ssh/clone/config (#50044) * GitHub proxy part 6.5: tsh git ssh/clone/config * review comments * fix test * fix ut for lookpath * fix logger and update dependency version * go mod tidy for integrations * GitHub proxy part 7: audit events (#49923) * GitHub proxy part 7: audit events * make Git Command consistent * fix typo * GitHub proxy: git command recorder (#50505) * GitHub proxy: recording git command * address review * review comments * allow flags after repository for git-upload-pack * GitHub proxy part 6: proxing Git using SSH transport (#49980) * GitHub proxy part 6: proxing Git using SSH transport * better command parsing and update suite * refactor * revert unnecearrty files * address review comments * ut fix * revert localsite_test.go * change special suffix to teleport-github-org for routing * fix routing ut * minor typo edit * fix ut after sshca change * add UT to sshutils * minor review comments * fix api ut because of special suffix change * GitServerReadOnlyClient * downgrade error to warning * run go mod tidy. not sure why it's needed * rename mock.go to mock_test.go * GitHub Proxy: complete audit event flow and add an enterprise guard (#51049) * fix lint and remove accidently checked-in binary * Fix flaky git.TestForwardServer test (#51112)
related:
examples: