Skip to content

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
}),
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.

@khendrikse khendrikse requested a review from eduardoboucas July 7, 2025 10:53
@khendrikse khendrikse requested a review from eduardoboucas July 7, 2025 12:16
@khendrikse khendrikse force-pushed the ex-114/add-extension-install-source-header branch from 50fa538 to 7132701 Compare July 7, 2025 12:33
import { ModeOption } from '../../types/options.js'
import { ROOT_PACKAGE_JSON } from '../json.js'

const configVersion = ROOT_PACKAGE_JSON.version
Copy link
Member

Choose a reason for hiding this comment

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

nit: This variable feels unnecessary.

"description": "Netlify config module",
"type": "module",
"exports": "./lib/index.js",
"exports": {
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to keep this change?

@kodiakhq kodiakhq bot merged commit ca66176 into main Jul 7, 2025
87 of 89 checks passed
@kodiakhq kodiakhq bot deleted the ex-114/add-extension-install-source-header branch July 7, 2025 14:49
This was referenced Jul 7, 2025
This was referenced Sep 2, 2025
This was referenced Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants