InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

WIP: [CI] Add OAS tool

Open matmair opened this issue 1 year ago β€’ 2 comments

Includes #7000 for testing, that will be removed at a later point

matmair avatar Apr 11 '24 17:04 matmair

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
Latest commit c5e2ba382cb39fe23c31c8b59434b4bef795041e
Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/6696e24a087c8a00084ef3e9

netlify[bot] avatar Apr 11 '24 17:04 netlify[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.11%. Comparing base (84d0768) to head (c081968). Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7002      +/-   ##
==========================================
+ Coverage   84.03%   84.11%   +0.08%     
==========================================
  Files        1094     1093       -1     
  Lines       48120    48049      -71     
  Branches     1480     1467      -13     
==========================================
- Hits        40438    40417      -21     
+ Misses       7288     7242      -46     
+ Partials      394      390       -4     
Flag Coverage Ξ”
backend 85.28% <100.00%> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 11 '24 17:04 codecov[bot]

This PR seems stale. Please react to show this is still important.

github-actions[bot] avatar Jun 21 '24 11:06 github-actions[bot]

Sample: https://github.com/matmair/InvenTree/actions/runs/9860962099/attempts/1#summary-27228345488

matmair avatar Jul 09 '24 17:07 matmair

@SchrodingersGat @wolflu05 should the diff also be added as a comment?

matmair avatar Jul 09 '24 17:07 matmair

As a comment in the PR, or where?

SchrodingersGat avatar Jul 10 '24 02:07 SchrodingersGat

As a PR comment. Not sure if it would be too noisy

matmair avatar Jul 10 '24 05:07 matmair

Do you mean this with the diff? image

In what scenarios would that be helpful? Maybe if the user forgets to bump the api version? Or is that a different story?

wolflu05 avatar Jul 10 '24 08:07 wolflu05

I don't think we need it as a comment.

SchrodingersGat avatar Jul 10 '24 10:07 SchrodingersGat

@wolflu05 it helps to see the real effect on the schema without making the diff yourself. This example shows that only the info field changed so a new API revision is unneeded. I find it hard to guestimate the real-world effects of changes in serializers and this diff helps to visualize the impact quickly.

matmair avatar Jul 10 '24 16:07 matmair

Would it be possible to please also provide an example for how this would look like if there was a bigger change in the api schema, e.g. an endpoint was added and another removed, so I can better understand how this "diff" is formatted?

wolflu05 avatar Jul 10 '24 16:07 wolflu05

@wolflu05 I have merged this with #7667 for a sample - here is the output https://github.com/matmair/InvenTree/actions/runs/9964062291/attempts/1#summary-27531527133

matmair avatar Jul 16 '24 21:07 matmair

ok, thank you very much for that example. That's quite a large amount of data for such a small change (adding 2 notes fields to two models), because this shows the changes very detailed. I don't think we need that as a comment too, as if the API schema is failing and we want to check the changes, we can easily jump into the Action output summary.

wolflu05 avatar Jul 16 '24 21:07 wolflu05

The small code change effects the response on 21 Endpoints, most of the them both on POST and GET. So not really a small change if you look at the schema - that is exactly the value of this change, it allows for easier discovery of effected endpoints.

matmair avatar Jul 17 '24 07:07 matmair

@matmair LMK when you are happy for me to merge this in then :)

SchrodingersGat avatar Jul 17 '24 08:07 SchrodingersGat

@SchrodingersGat yes, ready to merge

matmair avatar Jul 17 '24 13:07 matmair