openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

Update HttpRequest.cpp.mustache - use stable 4-parameter connect

Open Jazzco opened this issue 1 year ago • 20 comments

The 3-parameter connect is known to cause issues when the creating instance is deleted. In all other mustache you already use stable 4-parameter connect. In HttpRequest.cpp.mustache the fix was missing.

PR checklist

  • [x] Read the contribution guidelines.
  • [x] 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.
  • [x] Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH) 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*. IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • [x] File the PR against the correct branch: master (upcoming 7.6.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • [x] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Jazzco avatar Jun 10 '24 12:06 Jazzco

thanks for the PR. please follow step 3 to update the samples.

cc @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08)

wing328 avatar Jun 11 '24 12:06 wing328

I ran the parts of step 3, committed and pushed. Put I don't see a hint that these changes came in. Any hint what might went wrong?

Jazzco avatar Jun 11 '24 13:06 Jazzco

Ah wait - I pushed to my master .... need to push to patch-1

Jazzco avatar Jun 11 '24 13:06 Jazzco

Reviewing the changes I see a lot of path separator changes, obviously because I ran mvn and the scripts on Windows. Is that really what you want?

Jazzco avatar Jun 12 '24 07:06 Jazzco

@muttleyxd @MartinDelille when you guys have time, can you please PM me via Slack? Thanks.

wing328 avatar Jun 12 '24 15:06 wing328

Yes please push only the change regarding HttpRequest please!

As far as I see there is nothing changed but the manual change in HttpRequest, as long as the shifted entries of ApiException.php and readme.MD are irrelevant.

From a Windows user perspective the script I was asked to follow in step 3 is unusable in this state. Maybe it should be extended to replace all CR/LF by single LF.

I don't have the time to dig into it but the git bash seems to have commands for this:

find . -name "*.java" -exec dos2unix {} \;

Jazzco avatar Jun 13 '24 15:06 Jazzco

@Jazzco tests with updated samples failed: https://github.com/OpenAPITools/openapi-generator/actions/runs/9527512386/job/26264196606?pr=18939

can you please review the test failure when you've time?

wing328 avatar Jun 15 '24 10:06 wing328

@Jazzco tests with updated samples failed: https://github.com/OpenAPITools/openapi-generator/actions/runs/9527512386/job/26264196606?pr=18939

can you please review the test failure when you've time?

@wing328 I reviewed the change and don't see what could cause the issue. As mentioned above, step 3 produces many line break changes when processed on Windows, so I reverted it. Maybe I oversaw a generated change that was necessary but I guess it makes way more sense to run this script on Linux in the current state.

Locally generating our api and patching the results with these two changes afterwards works fine.

@ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) Could one of you please take over this tiny change? And maybe trigger your scripting team to fix the linefeed-issue

Regards Jazzco

Jazzco avatar Jun 17 '24 09:06 Jazzco

@muttleyxd @MartinDelille when you guys have time, can you please PM me via Slack? Thanks.

I sent you an email!

MartinDelille avatar Jun 17 '24 15:06 MartinDelille

I noticed that there were some other [clazy-connect-3arg-lambda] warnings, this time in api-body, and fixed them, too.

Jazzco avatar Jun 18 '24 09:06 Jazzco

To get this right I ran step 3 from a Linux vm and pushed the generated changes now.

Jazzco avatar Jun 18 '24 13:06 Jazzco

I tested these changes using Qt 5.15.2 on Windows. There were no compilation or link errors.

Jazzco avatar Jun 18 '24 14:06 Jazzco

There were () missing and it obviously worked with the 3 param version but failed with the 4 param version under macOS. Hopefully it builds now.

Jazzco avatar Jun 18 '24 14:06 Jazzco

the CI tests failed: https://github.com/OpenAPITools/openapi-generator/actions/runs/9567139672/job/26402928612?pr=18893

please take a look when you've time.

wing328 avatar Jun 19 '24 05:06 wing328

I'm out of ideas. The linker error is way to universal to track it down to a cause.

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Maybe if you were able to activate the -v option...

Jazzco avatar Jun 19 '24 06:06 Jazzco

Maybe if you were able to activate the -v option...

please update the workflow file to activate that

.github/workflows/samples-cpp-qt-client.yaml 

wing328 avatar Jun 19 '24 08:06 wing328

I tried to reproduce the issue locally on my mac using Qt 5.15.17 without issue.

MartinDelille avatar Jun 19 '24 15:06 MartinDelille

@MartinDelille The suggestions compile locally so I committed them.

Jazzco avatar Jun 27 '24 08:06 Jazzco

@wing328 any idea why the CI doesn't trigger properly ?

MartinDelille avatar Jun 28 '24 08:06 MartinDelille

triggered the workflow but some tests failed. please review when you guys have time

wing328 avatar Jun 28 '24 11:06 wing328

I create a draft PR to troubleshoot if the problem comes from the Qt installation in the CI: #19049

MartinDelille avatar Jul 02 '24 10:07 MartinDelille

The issue is not related to this PR changed. It should be fixed after #19049 is merged.

MartinDelille avatar Jul 02 '24 14:07 MartinDelille

@Jazzco please pull the latest master into your branch when you've time

wing328 avatar Jul 08 '24 11:07 wing328

@wing328 not sure the CI was triggered properly. Can you restart it by hand ?

MartinDelille avatar Jul 18 '24 14:07 MartinDelille

https://github.com/OpenAPITools/openapi-generator/actions/runs/9954301257/job/27620131137?pr=18893

please update the samples one more time

wing328 avatar Jul 18 '24 16:07 wing328

updated again

Jazzco avatar Jul 25 '24 15:07 Jazzco

@Jazzco can you make sure you have regenerated the sample accordingly ?

MartinDelille avatar Jul 26 '24 08:07 MartinDelille

@Jazzco can you make sure you have regenerated the sample accordingly ?

done

Jazzco avatar Jul 26 '24 10:07 Jazzco

@wing328 It looks like the CI wasnt' triggered properly. Any idea why ?

MartinDelille avatar Jul 29 '24 09:07 MartinDelille

There was a timeout warning. Maybe some resources were busy. I merged master in again to trigger a rebuild.

Jazzco avatar Aug 05 '24 07:08 Jazzco