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

feat: add config setting for cloud organization #1181

Merged
merged 1 commit into from
Oct 13, 2023
Merged

Conversation

snakster
Copy link
Contributor

Reason for This Change

When being member of multiple cloud organizations, the user had to set the environment variable TM_CLOUD_ORGANIZATION to the name of a specific one when syncing cloud data.
In many cases it would be more convenient to set this automatically per project via configuration.

Description of Changes

A new config setting has been added to the terramate config block. Usage example:

terramate {
  config {
    cloud {
      organization = "my-org-name"
    }
  }
}

TM_CLOUD_ORGANIZATION still works as before and overrides the config value if set.

@netlify
Copy link

netlify bot commented Oct 13, 2023

Deploy Preview for terramate-io-docs canceled.

Name Link
🔨 Latest commit 0ebe912
🔍 Latest deploy log https://app.netlify.com/sites/terramate-io-docs/deploys/652946e6773a600008b52007

@github-actions
Copy link

github-actions bot commented Oct 13, 2023

metric: time/op
ListFiles-2: old 149µs ± 1%: new 148µs ± 5%: delta: -0.39%
Generate-2: old 3.79s ± 2%: new 3.81s ± 2%: delta: 0.57%
GenerateRegex-2: old 2.43s ± 3%: new 2.44s ± 3%: delta: 0.00%
TokensForExpressionComplex-2: old 1.83ms ± 2%: new 1.85ms ± 3%: delta: 0.69%
TokensForExpressionPlainStringNoNewline-2: old 1.36µs ± 1%: new 1.39µs ± 1%: delta: 1.69%
TokensForExpressionStringWith100Newlines-2: old 44.5µs ± 3%: new 44.8µs ± 1%: delta: 0.59%
TokensForExpressionObjectWith100KeysWithNumberValues-2: old 2.12ms ± 1%: new 2.13ms ± 1%: delta: 0.38%
TokensForExpression-2: old 1.83ms ± 3%: new 1.86ms ± 3%: delta: 1.30%
PartialEvalComplex-2: old 609µs ± 7%: new 620µs ± 5%: delta: 1.75%
PartialEvalSmallString-2: old 5.19µs ± 2%: new 5.22µs ± 2%: delta: 0.52%
PartialEvalHugeString-2: old 2.56ms ± 1%: new 2.56ms ± 1%: delta: 0.00%
PartialEvalHugeInterpolatedString-2: old 7.02ms ± 5%: new 6.97ms ± 1%: delta: 0.00%
PartialEvalObject-2: old 30.7µs ± 6%: new 30.6µs ± 1%: delta: -0.22%
metric: alloc/op
ListFiles-2: old 99.5kB ± 0%: new 99.5kB ± 0%: delta: 0.00%
Generate-2: old 2.34GB ± 0%: new 2.34GB ± 0%: delta: 0.00%
GenerateRegex-2: old 953MB ± 0%: new 953MB ± 0%: delta: 0.00%
TokensForExpressionComplex-2: old 412kB ± 0%: new 412kB ± 0%: delta: 0.00%
TokensForExpressionPlainStringNoNewline-2: old 592B ± 0%: new 592B ± 0%: delta: 0.00%
TokensForExpressionStringWith100Newlines-2: old 14.0kB ± 0%: new 14.0kB ± 0%: delta: 0.00%
TokensForExpressionObjectWith100KeysWithNumberValues-2: old 402kB ± 0%: new 402kB ± 0%: delta: 0.00%
TokensForExpression-2: old 412kB ± 0%: new 412kB ± 0%: delta: 0.00%
PartialEvalComplex-2: old 353kB ± 0%: new 353kB ± 0%: delta: 0.00%
PartialEvalSmallString-2: old 1.74kB ± 0%: new 1.74kB ± 0%: delta: 0.00%
PartialEvalHugeString-2: old 166kB ± 0%: new 166kB ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-2: old 4.38MB ± 0%: new 4.38MB ± 0%: delta: 0.00%
PartialEvalObject-2: old 20.4kB ± 0%: new 20.4kB ± 0%: delta: 0.00%
metric: allocs/op
ListFiles-2: old 474 ± 0%: new 474 ± 0%: delta: 0.00%
Generate-2: old 25.9M ± 0%: new 25.9M ± 0%: delta: 0.00%
GenerateRegex-2: old 18.3M ± 0%: new 18.3M ± 0%: delta: 0.00%
TokensForExpressionComplex-2: old 4.93k ± 0%: new 4.93k ± 0%: delta: 0.00%
TokensForExpressionPlainStringNoNewline-2: old 21.0 ± 0%: new 21.0 ± 0%: delta: 0.00%
TokensForExpressionStringWith100Newlines-2: old 328 ± 0%: new 328 ± 0%: delta: 0.00%
TokensForExpressionObjectWith100KeysWithNumberValues-2: old 3.29k ± 0%: new 3.29k ± 0%: delta: 0.00%
TokensForExpression-2: old 4.93k ± 0%: new 4.93k ± 0%: delta: 0.00%
PartialEvalComplex-2: old 2.83k ± 0%: new 2.83k ± 0%: delta: 0.00%
PartialEvalSmallString-2: old 23.0 ± 0%: new 23.0 ± 0%: delta: 0.00%
PartialEvalHugeString-2: old 35.0 ± 0%: new 35.0 ± 0%: delta: 0.00%
PartialEvalHugeInterpolatedString-2: old 23.1k ± 0%: new 23.1k ± 0%: delta: 0.00%
PartialEvalObject-2: old 125 ± 0%: new 125 ± 0%: delta: 0.00%

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Attention: 38 lines in your changes are missing coverage. Please review.

Comparison is base (5709be6) 62.79% compared to head (3341d56) 62.76%.

❗ Current head 3341d56 differs from pull request most recent head 0ebe912. Consider uploading reports for the commit 0ebe912 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1181      +/-   ##
==========================================
- Coverage   62.79%   62.76%   -0.04%     
==========================================
  Files         102      102              
  Lines       16319    16395      +76     
==========================================
+ Hits        10248    10290      +42     
- Misses       5650     5681      +31     
- Partials      421      424       +3     
Flag Coverage Δ
tests 62.76% <51.89%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
test/hcl.go 77.50% <53.84%> (-1.16%) ⬇️
cmd/terramate/cli/cloud.go 0.00% <0.00%> (ø)
hcl/hcl.go 86.31% <65.38%> (-0.83%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@snakster snakster marked this pull request as ready for review October 13, 2023 11:47
@snakster snakster requested a review from a team as a code owner October 13, 2023 11:47
i4ki
i4ki previously approved these changes Oct 13, 2023
Copy link
Contributor

@i4ki i4ki left a comment

Choose a reason for hiding this comment

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

LGTM! Well done!!!

Are you going to update the changelog and docs in a follow-up PR?

cmd/terramate/e2etests/run_cloud_config_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@i4ki i4ki left a comment

Choose a reason for hiding this comment

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

LGTM

@snakster snakster added this pull request to the merge queue Oct 13, 2023
Merged via the queue into main with commit b0b6318 Oct 13, 2023
14 checks passed
@snakster snakster deleted the snk-config-cloud-org branch October 13, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants