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

[typescript-axios] Upgrade to axios@^1 #14518

Merged
merged 2 commits into from Nov 14, 2023

Conversation

segevfiner
Copy link
Contributor

Fixes #14517, we need to consider if this is a breaking change or not in terms of OpenAPI generator versioning.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04)

@macjohnny
Copy link
Member

It looks like this is a breaking change, so can you change the target branch to 7.0.0? Or we could introduce an option similar to the version in the typescript-angular generator

@segevfiner
Copy link
Contributor Author

It looks like this is a breaking change, so can you change the target branch to 7.0.0? Or we could introduce an option similar to the version in the typescript-angular generator

Yeah. It is. Do you prefer an option, which you can then change to be default in v7, or to do this for v7 only?

@macjohnny
Copy link
Member

If you are fine waiting for 7.0.0 to be released, lets do it without introducing an option, see https://github.com/OpenAPITools/openapi-generator/milestones

@segevfiner segevfiner changed the base branch from master to 7.0.x January 25, 2023 08:40
@segevfiner
Copy link
Contributor Author

@macjohnny Rebased to 7.0.x

Copy link
Member

@macjohnny macjohnny left a comment

Choose a reason for hiding this comment

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

LGTM
thanks for your contribution!

@macjohnny
Copy link
Member

can you have a look at the error

Run `npm audit` for details.

> typescript-axios-test@1.0.0 test
> mocha test/*.ts --require ts-node/register --timeout 10000


TypeError: Unknown file extension ".ts" for /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/typescript-axios/tests/default/test/PetApi.

in https://app.circleci.com/pipelines/github/OpenAPITools/openapi-generator/21734/workflows/dba99547-9932-4271-a5fd-d3c723b45ddc/jobs/58836?invite=true#step-116-2058

@segevfiner
Copy link
Contributor Author

Seems like something with package.json & package-lock.json files is still messed up, any idea?

@wing328 wing328 changed the base branch from 7.0.x to master May 16, 2023 18:08
@wing328 wing328 added this to the 7.0.0 milestone May 16, 2023
@MajdT51
Copy link

MajdT51 commented Jul 10, 2023

Hi :) any update on this PR ? thanks

@macjohnny
Copy link
Member

@segevfiner can you please merge the most recent master, resolve the conflicts and fix the tests?

@@ -22,7 +22,7 @@
"prepare": "npm run build"
},
"dependencies": {
"axios": "^0.26.1"
"axios": "^1.2.3"
Copy link

Choose a reason for hiding this comment

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

update to 1.4.0 if possible 1.4.0

Choose a reason for hiding this comment

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

Is it possible to update to 1.6.0. Previous versions contain CSRF vulnerability

@caioquirino
Copy link

@segevfiner I don't have access to CircleCI for some reason, but I am happy to help here. Can you try to rebase it again, while I try to be able to check the failed tests please? :)

@wing328 wing328 modified the milestones: 7.1.0, 7.2.0 Nov 13, 2023
@segevfiner
Copy link
Contributor Author

Rebased. It looks like the tests expect axios to get hoisted, but it doesn't get hoisted...

@segevfiner
Copy link
Contributor Author

Tried modifying the setup there to depend on axios explicitly but without specifying a version to force it to hoist and cleaned up the package.json, fixing a bogus npm install command there that made the tests depend on their run order.

@macjohnny macjohnny merged commit a460b7e into OpenAPITools:master Nov 14, 2023
19 checks passed
@caioquirino
Copy link

Awesome stuff @segevfiner / @macjohnny ! Is there any idea about when it will be generally available please? :) Thanks!

lwj5 pushed a commit to lwj5/openapi-generator that referenced this pull request Dec 5, 2023
* [typescript-axios] Upgrade to axios@^1

* Try fixing tests
@geemanjs geemanjs mentioned this pull request Dec 11, 2023
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.

[REQ] Upgrade typescript-axios to axios@^1
6 participants