Skip to content

Commit f5faacf

Browse files
authored
chore(all): prefix env with LIBRARIAN_ (#2749)
Update environment variable to prefix with `LIBRARIAN_`. Fixes #2716
1 parent 5072f0e commit f5faacf

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

doc/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ tests are **NOT** run automatically as they create pull requests and branches.
3939
Usage:
4040

4141
```bash
42-
TEST_GITHUB_TOKEN=<a personal access token> \
43-
TEST_GITHUB_REPO=<URL of GitHub repo> \
42+
LIBRARIAN_TEST_GITHUB_TOKEN=<a personal access token> \
43+
LIBRARIAN_TEST_GITHUB_REPO=<URL of GitHub repo> \
4444
go test ./...
4545
```
4646

47-
Note: `TEST_GITHUB_TOKEN` must have write access to `TEST_GITHUB_REPO`.
47+
Note: `LIBRARIAN_TEST_GITHUB_TOKEN` must have write access to `LIBRARIAN_TEST_GITHUB_REPO`.
4848

4949
Note: These tests are skipped unless these environment variables are set.

internal/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const (
5757
LibrarianStateFile = "state.yaml"
5858
// LibrarianConfigFile is the name of the language-repository config file.
5959
LibrarianConfigFile = "config.yaml"
60-
// LibrarianGithubToken is the name of the env var used to store the github token.
60+
// LibrarianGithubToken is the name of the env var used to store the GitHub token.
6161
LibrarianGithubToken = "LIBRARIAN_GITHUB_TOKEN"
6262
)
6363

@@ -68,7 +68,7 @@ var (
6868
)
6969

7070
var (
71-
// pullRequestRegexp is regular expression that describes a uri of a pull request.
71+
// pullRequestRegexp is regular expression that describes an uri of a pull request.
7272
pullRequestRegexp = regexp.MustCompile(`^https://github\.com/([a-zA-Z0-9-._]+)/([a-zA-Z0-9-._]+)/pull/([0-9]+)$`)
7373
)
7474

@@ -78,7 +78,7 @@ var (
7878
type Config struct {
7979
// API is the path to the API to be configured or generated,
8080
// relative to the root of the googleapis repository. It is a directory
81-
// name as far as (and including) the version (v1, v2, v1alpha etc). It
81+
// name as far as (and including) the version (v1, v2, v1alpha etc.). It
8282
// is expected to contain a service config YAML file.
8383
// Example: "google/cloud/functions/v2"
8484
//

internal/container/java/build-docker-and-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ echo "Building Docker image..."
2222
docker build -t "${IMAGE_NAME}" "${SCRIPT_DIR}"
2323

2424
echo "Running version check..."
25-
output=$(docker run --rm -e GOOGLE_SDK_JAVA_LOGGING_LEVEL=quiet "${IMAGE_NAME}" --version)
25+
output=$(docker run --rm -e LIBRARIAN_GOOGLE_SDK_JAVA_LOGGING_LEVEL=quiet "${IMAGE_NAME}" --version)
2626

2727
if [[ ! "$output" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
2828
echo "Version format is incorrect. Got: $output"

internal/container/java/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func main() {
3232
}
3333

3434
func runCLI(args []string) int {
35-
logLevel := parseLogLevel(os.Getenv("GOOGLE_SDK_JAVA_LOGGING_LEVEL"))
35+
logLevel := parseLogLevel(os.Getenv("LIBRARIAN_GOOGLE_SDK_JAVA_LOGGING_LEVEL"))
3636
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
3737
Level: logLevel,
3838
})))

system_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ import (
3131
"github.com/googleapis/librarian/internal/images"
3232
)
3333

34-
var testToken = os.Getenv("TEST_GITHUB_TOKEN")
35-
var githubAction = os.Getenv("GITHUB_ACTION")
34+
var testToken = os.Getenv("LIBRARIAN_TEST_GITHUB_TOKEN")
35+
var githubAction = os.Getenv("LIBRARIAN_GITHUB_ACTION")
3636

3737
func TestGetRawContentSystem(t *testing.T) {
3838
if testToken == "" {
39-
t.Skip("TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
39+
t.Skip("LIBRARIAN_TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
4040
}
4141
repoName := "https://github.com/googleapis/librarian"
4242

@@ -114,11 +114,11 @@ func TestPullRequestSystem(t *testing.T) {
114114
// Fetch the pull request
115115
// Close the pull request
116116
if testToken == "" {
117-
t.Skip("TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
117+
t.Skip("LIBRARIAN_TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
118118
}
119-
testRepoName := os.Getenv("TEST_GITHUB_REPO")
119+
testRepoName := os.Getenv("LIBRARIAN_TEST_GITHUB_REPO")
120120
if testRepoName == "" {
121-
t.Skip("TEST_GITHUB_REPO not set, skipping GitHub integration test")
121+
t.Skip("LIBRARIAN_TEST_GITHUB_REPO not set, skipping GitHub integration test")
122122
}
123123

124124
// Clone a repo
@@ -298,7 +298,7 @@ func TestPullRequestSystem(t *testing.T) {
298298

299299
func TestFindMergedPullRequest(t *testing.T) {
300300
if testToken == "" {
301-
t.Skip("TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
301+
t.Skip("LIBRARIAN_TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
302302
}
303303
repoName := "https://github.com/googleapis/librarian"
304304
repo, err := github.ParseRemote(repoName)
@@ -364,11 +364,11 @@ func TestFindMergedPullRequest(t *testing.T) {
364364

365365
func TestCreateTag(t *testing.T) {
366366
if testToken == "" {
367-
t.Skip("TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
367+
t.Skip("LIBRARIAN_TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
368368
}
369-
testRepoName := os.Getenv("TEST_GITHUB_REPO")
369+
testRepoName := os.Getenv("LIBRARIAN_TEST_GITHUB_REPO")
370370
if testRepoName == "" {
371-
t.Skip("TEST_GITHUB_REPO not set, skipping GitHub integration test")
371+
t.Skip("LIBRARIAN_TEST_GITHUB_REPO not set, skipping GitHub integration test")
372372
}
373373
repo, err := github.ParseRemote(testRepoName)
374374
if err != nil {
@@ -404,11 +404,11 @@ func TestCreateTag(t *testing.T) {
404404

405405
func TestCreateRelease(t *testing.T) {
406406
if testToken == "" {
407-
t.Skip("TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
407+
t.Skip("LIBRARIAN_TEST_GITHUB_TOKEN not set, skipping GitHub integration test")
408408
}
409-
testRepoName := os.Getenv("TEST_GITHUB_REPO")
409+
testRepoName := os.Getenv("LIBRARIAN_TEST_GITHUB_REPO")
410410
if testRepoName == "" {
411-
t.Skip("TEST_GITHUB_REPO not set, skipping GitHub integration test")
411+
t.Skip("LIBRARIAN_TEST_GITHUB_REPO not set, skipping GitHub integration test")
412412
}
413413
repo, err := github.ParseRemote(testRepoName)
414414
if err != nil {

0 commit comments

Comments
 (0)