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

Preserve reducer order in schema conversion #1987

Merged
merged 3 commits into from
Nov 16, 2024
Merged

Conversation

RReverser
Copy link
Contributor

Description of Changes

This was found while working on #1965. The tests will come in that other PR, but it was suggested that we should land the correctness fix itself sooner.

API and ABI breaking changes

If this is an API or ABI breaking change, please apply the
corresponding GitHub label.

Expected complexity level and risk

How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.

This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.

Testing

Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!

  • Write a test you've completed here.
  • Write a test you want a reviewer to do here, so they can check it off when they're satisfied.

This was found while working on #1965. The tests will come in that other PR, but it was suggested that we should land the correctness fix itself sooner.
Copy link
Contributor

@kazimuth kazimuth left a comment

Choose a reason for hiding this comment

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

This looks good, I think will need a corresponding Private PR.

This is inconsistent with how IDs work for other entity types.
Two alternatives would be:

  • Provide a _reducer_id_from_name API similar to indexes/tables
  • Require the user to sort their reducers when computing IDs

This is definitely the easiest patch though.

@RReverser
Copy link
Contributor Author

  • Require the user to sort their reducers when computing IDs

Do you mean with validation check? That would also be fine by me as an alternative.

@kazimuth
Copy link
Contributor

Yeah, I think that's less confusing overall. I can do another branch that adds that check in schema.

@RReverser
Copy link
Contributor Author

If you think that's better, sure, go for it.

Personally I don't care too much. I do think that preserving whatever order happens to be, is easier for module binding libraries, particularly because a validation error would be visible a bit late in the pipeline (user would get an error only when an example module with mismatched order is compiled & published), but given that we only have 2 such libraries and not creating new one every month or so, it shouldn't be a big deal.

@kazimuth
Copy link
Contributor

Ah, no, you're right. I was confused -- it really doesn't matter inside the module, the module never uses reducer IDs. It's just an interface somewhere else. So, I'm happy with this.

Copy link
Contributor

@kazimuth kazimuth left a comment

Choose a reason for hiding this comment

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

LGTM with tests passing

@RReverser
Copy link
Contributor Author

That's... some new test failure.

This looks good, I think will need a corresponding Private PR.

Also, does this still stand / do I need to change private too?

@kazimuth
Copy link
Contributor

It looks like both test failures here were caused by unrelated heisenbugs on master, we don't need a Private fix. This one might also go away on rerun.

@RReverser RReverser added this pull request to the merge queue Nov 16, 2024
Merged via the queue into master with commit ac1d222 Nov 16, 2024
8 checks passed
@RReverser RReverser deleted the ingvar/fix-reducer-order branch November 16, 2024 11:55
bfops pushed a commit that referenced this pull request Dec 24, 2024
…sion (#1987)

Signed-off-by: Ingvar Stepanyan <[email protected]>
Co-authored-by: james gilles <[email protected]>
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.

2 participants