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

Add gitbranch and sha into spaces payload #4734

Merged
merged 36 commits into from May 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7da2236
Add gitbranch and sha into spaces payload
mehulkar Apr 26, 2023
305be40
rm debug
mehulkar Apr 27, 2023
084a1e7
comments
mehulkar Apr 27, 2023
5f1a8ae
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
mehulkar Apr 28, 2023
8cfeb18
return struct instead of tuple
mehulkar Apr 28, 2023
213b9f5
Use branch --show-current to get branch name instead
mehulkar Apr 28, 2023
0d57d8c
ONly use stdout, ignore stderr
mehulkar Apr 28, 2023
8d1db8d
git state
mehulkar Apr 28, 2023
4de2dbf
look up env vars more simply
mehulkar Apr 28, 2023
c8553ff
rm comment
mehulkar Apr 28, 2023
0975950
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
mehulkar Apr 28, 2023
9455443
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
mehulkar May 2, 2023
ef0621b
Move gitState to run summary instead of just spaces
mehulkar May 2, 2023
da9917a
add tests, fix key, remove newline char
mehulkar May 2, 2023
1e9d30d
Set CWD when getting git info
mehulkar May 2, 2023
dd4a603
compile err
mehulkar May 2, 2023
35dda2b
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
mehulkar May 2, 2023
c1e3d68
branch names can be anything
mehulkar May 2, 2023
bffe3ce
stringify at the end
mehulkar May 2, 2023
2199840
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
mehulkar May 2, 2023
21ff859
Use scm key/struct naming for run summary, keep git fields for spaces
mehulkar May 2, 2023
f1daab1
Fix tests
mehulkar May 2, 2023
c480e15
add unit tests for git branch/sha
mehulkar May 2, 2023
ced3468
more logging on fail
mehulkar May 2, 2023
23c13ac
print byte string correctly
mehulkar May 2, 2023
cdda67c
setup git first
May 2, 2023
9363c2e
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
May 2, 2023
6e5aa1c
yes
May 2, 2023
fae2b88
only set local git user in test, so it doesn't blow up dev machines
May 3, 2023
c443620
set local without flag
May 3, 2023
29410e3
set --global git config in tests and reset after
mehulkar May 3, 2023
b37ef03
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
May 3, 2023
ae52ed8
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
May 3, 2023
467feb2
show which cmd failed
May 3, 2023
90ee2f5
Ignore errors when no global config exists
May 3, 2023
9440bbe
Merge branch 'main' into mehulkar/turbo-1049-add-git-sha-and-branch-t…
May 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions cli/internal/scm/scm_test.go
Expand Up @@ -15,8 +15,8 @@ func TestGetCurrentBranchMain(t *testing.T) {
testDir := getTestDir(t, "myrepo")

// Setup git
gitCommand(t, testDir, []string{"config", "--global", "user.email", "turbo@vercel.com"})
gitCommand(t, testDir, []string{"config", "--global", "user.name", "Turbobot"})
gitCommand(t, testDir, []string{"config", "--local", "user.email", "turbo@vercel.com"})
nathanhammond marked this conversation as resolved.
Show resolved Hide resolved
gitCommand(t, testDir, []string{"config", "--local", "user.name", "Turbobot"})
gitCommand(t, testDir, []string{"init"})

gitCommand(t, testDir, []string{"checkout", "-B", targetbranch})
Expand All @@ -31,8 +31,8 @@ func TestGetCurrentBranchNonMain(t *testing.T) {
targetbranch := "mybranch"
testDir := getTestDir(t, "myrepo")
// Setup git
gitCommand(t, testDir, []string{"config", "--global", "user.email", "turbo@vercel.com"})
gitCommand(t, testDir, []string{"config", "--global", "user.name", "Turbobot"})
gitCommand(t, testDir, []string{"config", "--local", "user.email", "turbo@vercel.com"})
gitCommand(t, testDir, []string{"config", "--local", "user.name", "Turbobot"})
gitCommand(t, testDir, []string{"init"})
gitCommand(t, testDir, []string{"checkout", "-B", targetbranch})

Expand All @@ -46,8 +46,8 @@ func TestGetCurrentBranchNonMain(t *testing.T) {
func TestGetCurrentSHA(t *testing.T) {
testDir := getTestDir(t, "myrepo")
// Setup git
gitCommand(t, testDir, []string{"config", "--global", "user.email", "turbo@vercel.com"})
gitCommand(t, testDir, []string{"config", "--global", "user.name", "Turbobot"})
gitCommand(t, testDir, []string{"config", "--local", "user.email", "turbo@vercel.com"})
gitCommand(t, testDir, []string{"config", "--local", "user.name", "Turbobot"})
gitCommand(t, testDir, []string{"init"})

// initial sha is blank because there are no commits
Expand Down