Skip to content

Conversation

ndhoule
Copy link
Contributor

@ndhoule ndhoule commented Apr 9, 2025

Currently, we conditionally attempt to retrieve information about addons in @netlify/config#resolveConfig. As far as I can tell, every query to the listServiceInstancesForSite (addon info) Bitballoon endpoint fails with a 500 and the following response body:

{"message":"Missing Authentication Token"}

...this, despite verifying that e.g. the accounts and site info queries right next to it use the exact same API token and succeed.

Unfortunately, because of the way we do error handling, when this query fails it fails all of the surrounding queries. We could change this code path to have separate try/catches for each query, but the CLI (and probably other consumers) currently assume this behavior, so that would be an obtrusive change.

Addons are a thing of the past and we're fairly sure no one is using them any longer. (The CLI is certainly not.) Any consumers of this module who still rely on this information and for whom this query somehow does work can instead perform this query in application code.

I started out just removing this from the @netlify/config module, but decided to remove addons entirely from this repo as to not leave this confusing vestigial concept around.

@ndhoule ndhoule force-pushed the fix/remove-addons-query-resolveconfig branch 2 times, most recently from db5882a to 2354a7d Compare April 9, 2025 21:35
@ndhoule ndhoule changed the title fix!: remove getAddons query from fix!: remove getAddons query from resolveConfig Apr 9, 2025
@ndhoule ndhoule force-pushed the fix/remove-addons-query-resolveconfig branch from 2354a7d to 6e9b9d5 Compare April 9, 2025 22:14
Copy link
Contributor

github-actions bot commented Apr 9, 2025

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

@ndhoule ndhoule changed the title fix!: remove getAddons query from resolveConfig fix!: remove addons Apr 9, 2025
@ndhoule ndhoule force-pushed the fix/remove-addons-query-resolveconfig branch from 6e9b9d5 to b6de27c Compare April 9, 2025 22:15
Copy link
Contributor

github-actions bot commented Apr 9, 2025

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

@ndhoule ndhoule force-pushed the fix/remove-addons-query-resolveconfig branch from b6de27c to a6770d0 Compare April 9, 2025 22:36
Copy link
Contributor

github-actions bot commented Apr 9, 2025

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

@ndhoule ndhoule marked this pull request as ready for review April 9, 2025 22:58
@ndhoule ndhoule requested a review from a team as a code owner April 9, 2025 22:58
_Type_: `NetlifyClient?`

Netlify [JavaScript client instance](https://github.com/netlify/js-client) used to retrieve [`siteInfo`](#siteinfo),
[`accounts`](#accounts) and [`addons`](#addons).
Copy link
Contributor

Choose a reason for hiding this comment

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

I did a humio search for path="/api/v1/sites/*/service-instances" and have a handful of requests with ua=netlify/js-client. Are they not coming from this repository? Do you have a sense of where they are coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are other consumers of the netlify package, so it's hard to say. Certainly at least some of those requests are originating from this repository (I'm removing the code that performs these requests), but I think the more salient question is: Is anyone using the data returned from this query? (Eduardo seems to think no (internal link))

If anyone actually is relying on this data, I've laid out the migration path. (I'd also be happy to help contribute changes if someone can tell me where we're using this data.) But as far as I've been able to figure out, this is just vestigial code.

Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

LGTM

Currently, we conditionally attempt to retrieve information about addons
in `@netlify/config#resolveConfig`. As far as I can tell, every query to
the `listServiceInstancesForSite` (addon info) Bitballoon endpoint fails
with a 500 and the following response body:

```json
{ error: '{"message":"Missing Authentication Token"}' }
```

...this, despite verifying that e.g. the accounts and site info queries
right next to it use the exact same API token and succeed.

Unfortunately, because of the way we do error handling, when this query
fails it fails all of the surrounding queries. We could change this code
path to have separate `try/catch`es for each query, but the CLI (and
probably other consumers) currently assume this behavior, so that would
be an obtrusive change.

Addons are a thing of the past and we're fairly sure no one is using
them any longer. (The CLI is certainly not.) Any consumers of this
module who still rely on this information  and for whom this query
somehow _does_ work can instead perform this query in application code.

I started out just removing this from the `@netlify/config` module, but
decided to remove addons entirely from this repo as to not leave this
confusing vestigial concept around.
@ndhoule ndhoule force-pushed the fix/remove-addons-query-resolveconfig branch from a6770d0 to 13405df Compare April 10, 2025 18:32
@ndhoule ndhoule enabled auto-merge (squash) April 10, 2025 18:32
Copy link
Contributor

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

@ndhoule ndhoule merged commit c4f7caa into main Apr 10, 2025
33 checks passed
@ndhoule ndhoule deleted the fix/remove-addons-query-resolveconfig branch April 10, 2025 18:58
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