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

BoxesResponse: Fold names into top-level object #4249

Merged
merged 2 commits into from
Jul 12, 2022

Conversation

michaeldiamant
Copy link
Contributor

Due to algorand/generator#36, it's not possible to generate working Java and Go SDK changes prior to the PR (see algorand/go-algorand-sdk#340 as an example).

Consequently, the PR proposes re-defining the response for /v2/applications/{application-id}/boxes to be compatible with as-is generator capabilities.

Notes:

  • Since a Box definition exists (returning name + value), the PR proposes a new definition: BoxDescriptor. I'm open to different names. The intent is to use a name that may be extended with new fields in the future.
  • Alternatives considered:
    • Keep PR as is and return array of box names rather than array of BoxDescriptor. The approach is a better fit for today's model. However, if we later modify the response type, it'll introduce a backwards incompatible change.
    • Close PR and instead modify generator templates to produce expected changes. The approach feels more error prone than the PR's approach.

@codecov
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #4249 (3421bd3) into feature/avm-box (f394799) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@                 Coverage Diff                 @@
##           feature/avm-box    #4249      +/-   ##
===================================================
- Coverage            54.58%   54.57%   -0.01%     
===================================================
  Files                  393      393              
  Lines                49283    49284       +1     
===================================================
- Hits                 26899    26898       -1     
- Misses               20115    20117       +2     
  Partials              2269     2269              
Impacted Files Coverage Δ
daemon/algod/api/server/v2/handlers.go 0.00% <0.00%> (ø)
ledger/blockqueue.go 82.18% <0.00%> (-2.88%) ⬇️
data/abi/abi_type.go 87.67% <0.00%> (-0.95%) ⬇️
network/wsPeer.go 67.67% <0.00%> (-0.55%) ⬇️
network/wsNetwork.go 65.17% <0.00%> (+0.28%) ⬆️
ledger/acctupdates.go 65.60% <0.00%> (+0.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f394799...3421bd3. Read the comment docs.

Copy link
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

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

seems a reasonable change, I am not tagged to review so I just comment here.

It just surprise me that the generated model cannot handle response type of array of strings, and I wrote most of the code here, so I kinda feel guilty about it.

@michaeldiamant
Copy link
Contributor Author

I wrote most of the code here, so I kinda feel guilty about it.

@ahangsu No worries and no need to feel guilty! It's an unexpected outcome and the SDKs are outside the scope of #4154.

Copy link
Contributor

@algochoi algochoi left a comment

Choose a reason for hiding this comment

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

Looks good to me, as discussed off line

daemon/algod/api/algod.oas2.json Show resolved Hide resolved
Copy link
Contributor

@algochoi algochoi left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

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

free approval

Copy link
Contributor

@algoidurovic algoidurovic left a comment

Choose a reason for hiding this comment

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

LGTM

@michaeldiamant michaeldiamant merged commit 34312c8 into feature/avm-box Jul 12, 2022
@michaeldiamant michaeldiamant deleted the boxes_response_rework branch July 12, 2022 17:25
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.

4 participants