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

fix: pass api host to @netlify/build #6424

Merged
merged 3 commits into from Mar 11, 2024
Merged

fix: pass api host to @netlify/build #6424

merged 3 commits into from Mar 11, 2024

Conversation

davbree
Copy link
Contributor

@davbree davbree commented Mar 10, 2024

If API host is configured to staging, currently CLI will use that but @netlify/build will use production.
To fix this we need to pass in the configured host to @netlify/build.

@davbree davbree requested a review from a team as a code owner March 10, 2024 06:57
Copy link

github-actions bot commented Mar 10, 2024

📊 Benchmark results

Comparing with b4d8fec

  • Dependency count: 1,328 (no change)
  • Package size: 305 MB (no change)
  • Number of ts-expect-error directives: 1,179 (no change)

@davbree davbree enabled auto-merge (squash) March 11, 2024 06:37
@@ -66,6 +66,7 @@ export const runNetlifyBuild = async ({ command, env = {}, options, settings, ti
configPath: cachedConfig.configPath,
siteId: cachedConfig.siteInfo.id,
token: cachedConfig.token,
host: apiOpts.host,
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the property called apiHost instead of host? https://github.com/netlify/build/blob/2d10996ee91e7640be0e4b53105ae30cb42752fe/packages/build/src/core/normalize_flags.ts#L94

Also, we're already doing something similar here. I understand these are currently different entry points into @netlify/build, but it'd be nice to at least standardise the way we pass these properties so it's easier for us to consolidate things into a single entry point in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, not sure what happened there!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

re standardization - apiOpts seemed like the best way because it's defined in base-command, but open for suggestions 😄

@davbree davbree merged commit 9b8694e into main Mar 11, 2024
40 checks passed
@davbree davbree deleted the fix/api-host branch March 11, 2024 10:23
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