bump-sh / cli

Bump.sh CLI - Deploy your OpenAPI & AsyncAPI documentations from your CI
https://bump.sh
MIT License
39 stars 2 forks source link

Bug: Diff of a valid file with itself is not empty #559

Closed noudin-ledger closed 5 months ago

noudin-ledger commented 6 months ago

Bump CLI fails to validate that the diff of a file with itself is always empty.

It was the case in the past, and now it fails. Here is the a gist of the file: https://gist.github.com/noudin-ledger/66d6d2bac60e43fd467f25287d436e89 This fails with:

$ bump diff api-spec.yaml api-spec.yaml
* Comparing the two given definition files... done
Modified: GET /schema/{schema_id}
  Response modified: 200
    Content type modified: application/json
      [Breaking] Attribute modified: all2
        [Breaking] Alternative removed: AllOf1
        [Breaking] Alternative added: AllOf1

The error is triggered by the fact that the SchemaEntry schema component contains two properties that are defined by a allOf. If I remove one of the two, it works. As I have seen no change in the code that could explain this, I think it might be a dependency issue, but I haven't nailed it down yet. The error in itself seems to show that bump cli fails to detect that AllOf1 and AllOf1 are the same:

[Breaking] Alternative removed: AllOf1
[Breaking] Alternative added: AllOf1

Extra informations:

$ bump --version
bump-cli/2.7.3 linux-x64 node-v18.16.0

$ node --version
v18.16.0

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy

I installed bump with yarn global add bump-cli

paulRbr commented 6 months ago

Hi @noudin-ledger,

Thanks a lot for the feedback and the detailed issue.

It does seem like a bug on our side on the way we work with allOf (the diff computation is not made in the CLI codebase, but on our cloud platform Bump.sh). I'll try to take some time to debug this next week and let you know when this is fixed.

noudin-ledger commented 6 months ago

Thanks :)

paulRbr commented 5 months ago

Hi @noudin-ledger, sorry for the long response time but this but has been fixed last week.

Let me know if you have any other questions and feel free to open up another issue if needed.

noudin-ledger commented 5 months ago

Hello, thanks for answering and fixing the issue! Don't worry if I have any question or new issues, I'll open one!