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

Make returned parameters consistent with its call in POST /source?cmd=branch #16072

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eduardoj
Copy link
Member

@eduardoj eduardoj commented Apr 29, 2024

Instead of renaming the parameters (that would be an incompatible change), add elements with the names the parameters will take in the next version.

Before

> curl -H 'Content-Type: application/xml' -u Admin:opensuse -X POST "http://localhost:3000/source?cmd=branch&project=home:Admin&package=hello_world&target_project=home:Admin:branches&target_package=hello_world"
<status code="ok">
  <summary>Ok</summary>
  <data name="targetproject">home:Admin:branches</data>
  <data name="targetpackage">hello_world</data>
  <data name="sourceproject">home:Admin</data>
  <data name="sourcepackage">hello_world</data>
</status>

After

> curl -H 'Content-Type: application/xml' -u Admin:opensuse -X POST "http://localhost:3000/source?cmd=branch&project=home:Admin&package=hello_world&target_project=home:Admin:branches&target_package=hello_world"
<status code="ok">
  <summary>Ok</summary>
  <data name="target_project">home:Admin:branches</data>
  <data name="target_package">hello_world</data>
  <data name="project">home:Admin</data>
  <data name="package">hello_world</data>
  <data name="targetproject">home:Admin:branches</data>
  <data name="targetpackage">hello_world</data>
  <data name="sourceproject">home:Admin</data>
  <data name="sourcepackage">hello_world</data>
</status>

Fixes #16027.

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label Apr 29, 2024
@adrianschroeter
Copy link
Member

That is an incompatible change, we can do that for 3.0, but not atm.

@adrianschroeter adrianschroeter self-requested a review April 29, 2024 15:38
Copy link
Member

@adrianschroeter adrianschroeter left a comment

Choose a reason for hiding this comment

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

no reject button, so request changes

@adrianschroeter
Copy link
Member

in theory, you could add the "new" elements, so data would be duplicated until 3.0. But IMHO a bit cringe and confusing.

@eduardoj
Copy link
Member Author

in theory, you could add the "new" elements, so data would be duplicated until 3.0. But IMHO a bit cringe and confusing.

True. I can do that after fixing the tests. It seems fixing the tests will require not only modifying the tests, but also make other parts of the code understand the renamed parameters. Leaving it in WIP.

@eduardoj eduardoj changed the title Make returned parameters consistent with its call in POST /source?cmd=branch [WIP] Make returned parameters consistent with its call in POST /source?cmd=branch Apr 29, 2024
@eduardoj eduardoj force-pushed the fix/issue_16027 branch 3 times, most recently from 0b4723c to e2c381f Compare April 30, 2024 14:40
@github-actions github-actions bot added the Documentation 📖 Things regarding our documentation label Apr 30, 2024
@eduardoj eduardoj force-pushed the fix/issue_16027 branch 3 times, most recently from c3a0060 to 6ac62e3 Compare April 30, 2024 15:09
@eduardoj eduardoj changed the title [WIP] Make returned parameters consistent with its call in POST /source?cmd=branch Make returned parameters consistent with its call in POST /source?cmd=branch Apr 30, 2024
@eduardoj eduardoj marked this pull request as ready for review April 30, 2024 15:38
@eduardoj
Copy link
Member Author

in theory, you could add the "new" elements, so data would be duplicated until 3.0. But IMHO a bit cringe and confusing.

I followed your suggestion. I didn't find any other way of making the return parameters work without provoking an incompatible change. Please take a look again.

@eduardoj eduardoj force-pushed the fix/issue_16027 branch 3 times, most recently from af3fef9 to 43bee18 Compare May 6, 2024 15:43
@eduardoj
Copy link
Member Author

@adrianschroeter, gently ping...

@adrianschroeter
Copy link
Member

I hate it, but accept it ;)

However, please keep the tests in test/functional/maintenance_test.rb with old variable to ensure that we don't break api without noticing. You may add a comment there for the rename.

@eduardoj eduardoj force-pushed the fix/issue_16027 branch 2 times, most recently from e2d322b to 5940d48 Compare May 13, 2024 12:45
@eduardoj
Copy link
Member Author

I hate it, but accept it ;)

🙂

However, please keep the tests in test/functional/maintenance_test.rb with old variable to ensure that we don't break api without noticing. You may add a comment there for the rename.

Done. Please take a look again.

... in POST /source?cmd=branch

Instead of renaming the parameters (that would be an incompatible
change), add elements with the names the parameters will take in the
next version.
... of the parameters returned by `POST /source?cmd=branch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation 📖 Things regarding our documentation Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent naming of the target_project & target_package parameters in POST /source?cmd=branch
2 participants