Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes axios from the AWX UI and replaces the shared API HTTP client in awx/ui/src/api/Base.js with a native fetch-based implementation, reducing transitive npm dependencies while keeping the existing API wrapper surface (get/post/put/patch/delete/options) intact.
Changes:
- Replace
axios.create(...)+ response interceptor logic with a customfetchwrapper (makeRequest/handleResponse) inBase.js. - Update Jest test setup to mock
global.fetchinstead of mockingaxios. - Remove
axiosfromawx/ui/package.jsonand update documentation describing query param serialization.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| awx/ui/src/setupTests.js | Switch network-request guard from axios mocking to global.fetch mocking. |
| awx/ui/src/api/Base.js | Implement a fetch-based HTTP client replacing axios (CSRF header, params, response parsing, error shaping, session timeout header handling). |
| awx/ui/SEARCH.md | Update REST API search docs to remove axios-specific language. |
| awx/ui/package.json | Drop axios dependency. |
| awx/ui/package-lock.json | Remove axios and adjust transitive dependency graph/dev flags accordingly. |
Files not reviewed (1)
- awx/ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- awx/ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- awx/ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- awx/ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- awx/ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- awx/ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In light of the recent axios compromise (which didn't affect us, we are on an older version); I thought it best to re-examine our use of it.
There are other alternatives now, including the browser native function Fetch, which can be used without any dependencies. We only use axios in a single location in Base.js, which makes replacing it fairly trivial.
This PR takes care of replacing axios with the native fetch. The only drawback is we must now handle building the requests, catching errors, etc.. ourselves, but as you can see, its not that much more code to do so.
This ends up removing a total of 6 npm packages (dependencies of dependencies) and moves another 16 to be only dev dependencies.