Skip to content

feat: add header to installing extension with the build mode so we know where the installation is coming from #6478

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

khendrikse
Copy link
Contributor

@khendrikse khendrikse commented Jun 17, 2025

🎉 Thanks for submitting a pull request! 🎉

Summary

This adds a user agent header to our installation of auto-installable extensions.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@khendrikse khendrikse marked this pull request as ready for review June 18, 2025 12:48
@khendrikse khendrikse requested a review from a team as a code owner June 18, 2025 12:48
@@ -32,6 +35,7 @@ export const installExtension = async ({
}),
headers: {
'netlify-token': netlifyToken,
'User-Agent': extensionInstallSource,
Copy link
Member

Choose a reason for hiding this comment

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

So the user agent will be 'buildbot' | 'cli' | 'require'? For future-proofness, do we want to be a bit more descriptive and include the fact that we're calling from Netlify Build, potentially including the version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm yeah, it's not always netlify build though, could be the call to netlify config they do (we still have the double call thing)

Copy link
Contributor

@ndhoule ndhoule Jun 18, 2025

Choose a reason for hiding this comment

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

I'd suggest something like:

User-Agent: Netlify Build (mode:${extensionInstallationSource}) / ${buildVersion}

If there's any other arbitrary metadata that might be useful to us later in analysis, we can include it semicolon-delimited in the parenthetical.

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.

3 participants