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

Rename api address overwrite #57

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Upload results using action from ${{ matrix.target }}
env:
TRUNK_API_ADDRESS: https://api.trunk-staging.io
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
run: |
target/${{ matrix.target }}/release/trunk-analytics-cli upload \
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Upload results cli release built from source
if: "!cancelled()"
env:
TRUNK_API_ADDRESS: https://api.trunk-staging.io
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
run: |
cargo run --release -- upload \
--junit-paths ${{ github.workspace }}/target/**/*junit.xml \
Expand Down
2 changes: 1 addition & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub const EXIT_FAILURE: i32 = 1;

pub const CODEOWNERS_LOCATIONS: &[&str] = &[".github/", ".bitbucket/", ".gitlab/", "docs/"];

pub const TRUNK_API_ADDRESS_ENV: &str = "TRUNK_API_ADDRESS";
pub const TRUNK_PUBLIC_API_ADDRESS_ENV: &str = "TRUNK_PUBLIC_API_ADDRESS";
pub const ENVS_TO_GET: &'static [&'static str] = &[
"CI",
"GIT_BRANCH",
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tokio_retry::strategy::ExponentialBackoff;
use tokio_retry::Retry;
use trunk_analytics_cli::bundler::BundlerUtil;
use trunk_analytics_cli::clients::get_quarantine_bulk_test_status;
use trunk_analytics_cli::constants::{EXIT_FAILURE, EXIT_SUCCESS, TRUNK_API_ADDRESS_ENV};
use trunk_analytics_cli::constants::{EXIT_FAILURE, EXIT_SUCCESS, TRUNK_PUBLIC_API_ADDRESS_ENV};
use trunk_analytics_cli::runner::run_test_command;
use trunk_analytics_cli::scanner::{BundleRepo, EnvScanner, FileSet, FileSetCounter};
use trunk_analytics_cli::types::{BundleMeta, QuarantineBulkTestStatus, RunResult, META_VERSION};
Expand Down Expand Up @@ -137,7 +137,7 @@ async fn run_upload(upload_args: UploadArgs, test_command: Option<String>) -> an
}

let api_address = from_non_empty_or_default(
std::env::var(TRUNK_API_ADDRESS_ENV).ok(),
std::env::var(TRUNK_PUBLIC_API_ADDRESS_ENV).ok(),
DEFAULT_ORIGIN.to_string(),
|s| s,
);
Expand Down Expand Up @@ -296,7 +296,7 @@ async fn run_test(test_args: TestArgs) -> anyhow::Result<i32> {
}

let api_address = from_non_empty_or_default(
std::env::var(TRUNK_API_ADDRESS_ENV).ok(),
std::env::var(TRUNK_PUBLIC_API_ADDRESS_ENV).ok(),
DEFAULT_ORIGIN.to_string(),
|s| s,
);
Expand Down