Skip to content

Commit

Permalink
internal/ci: move core._#URLPath to base
Browse files Browse the repository at this point in the history
It never belonged in core.

This change should not result in any .github/workflows changes.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: Ie015dff76626c9166d5b911233761745544f5510
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551379
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
myitcv committed Mar 25, 2023
1 parent 8b14836 commit dd965ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
10 changes: 10 additions & 0 deletions internal/ci/base/base.cue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package base

import (
"list"
"strings"
"path"
"strconv"
Expand Down Expand Up @@ -187,3 +188,12 @@ let _#botGitHubUserTokenSecretsKey = #botGitHubUserTokenSecretsKey
// Per https://pkg.go.dev/golang.org/x/review/git-codereview#hdr-Configuration
strings.Join(parts, "\n")
}

// #URLPath is a temporary measure to derive the path part of a URL.
//
// TODO: remove when cuelang.org/issue/1433 lands.
#URLPath: {
#url: string
let parts = strings.Split(#url, "/")
strings.Join(list.Slice(parts, 3, len(parts)), "/")
}
13 changes: 1 addition & 12 deletions internal/ci/core/core.cue
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,15 @@
package core

import (
"list"
"strings"

"cuelang.org/go/internal/ci/base"
)

// Define core URLs that will be used in the codereview.cfg and GitHub workflows
githubRepositoryURL: "https://github.com/cue-lang/cue"
gerritRepositoryURL: "https://review.gerrithub.io/a/cue-lang/cue"
githubRepositoryPath: _#URLPath & {#url: githubRepositoryURL, _}
githubRepositoryPath: base.#URLPath & {#url: githubRepositoryURL, _}
unityRepositoryURL: "https://github.com/cue-unity/unity"

// Not ideal, but hack together something that gives us the path
// of a URL. In lieu of cuelang.org/issue/1433
_#URLPath: {
#url: string
let parts = strings.Split(#url, "/")
strings.Join(list.Slice(parts, 3, len(parts)), "/")
}

// Use the latest Go version for extra checks,
// such as running tests with the data race detector.
latestStableGo: "1.19.x"
Expand Down

0 comments on commit dd965ad

Please sign in to comment.