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

Remove uses of sets() which make iteration order unpredictable. #566

Merged
merged 7 commits into from
Jan 4, 2022

Conversation

prescod
Copy link
Contributor

@prescod prescod commented Dec 22, 2021

A user reported that in some cases her recipe loaded okay and in other cases it failed. The underlying cause of the failed loads is that there are two tables that had an implicit, not explicit, dependency. A picklist populated by CampaignMemberStatus had to be loaded before CampaignMembers could be.

We already have a way to force a load order, but my concern was that the intermittent behaviour made tracking down the source of the problem harder.

Also: the user's mental model was that the load order would follow the recipe.

AC:

This change ensures that the load order does actually follow the recipe except if a dependency can be inferred. Dependency order takes priority over recipe declaration order.

@prescod prescod requested a review from a team as a code owner December 22, 2021 06:17
@davisagli
Copy link
Contributor

What work item is this related to?

@prescod
Copy link
Contributor Author

prescod commented Dec 22, 2021

It's related to an issue reported by users in Slack.

@prescod prescod marked this pull request as draft December 22, 2021 19:09
@prescod prescod marked this pull request as ready for review December 24, 2021 06:09
@prescod prescod force-pushed the feature/ordered-sets branch from 0cf4672 to a119a56 Compare December 24, 2021 06:23
@prescod prescod requested a review from pconrad-sfdo December 24, 2021 06:23
@@ -51,6 +50,14 @@ $ cci flow run test_everything
...
```

The order in which sobjects is loaded is inferred by Snowfakery and CumulusCI
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The order in which sobjects is loaded is inferred by Snowfakery and CumulusCI
Snowfakery and CumulusCI infer the order in which sObjects are loaded

snowfakery/utils/collections.py Outdated Show resolved Hide resolved
@@ -51,6 +50,14 @@ $ cci flow run test_everything
...
```

The order in which sobjects is loaded is inferred by Snowfakery and CumulusCI
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The order in which sobjects is loaded is inferred by Snowfakery and CumulusCI
Snowfakery and CumulusCI infer the order in which sObjects are loaded

@prescod
Copy link
Contributor Author

prescod commented Jan 4, 2022

Text is now:

Snowfakery and CumulusCI infer the order in which sObjects are loaded
based primarily on which tables have fields that depend on which other
tables.

@prescod prescod requested a review from davisagli January 4, 2022 19:11
@prescod prescod enabled auto-merge (squash) January 4, 2022 19:11
@prescod prescod merged commit f1b83c3 into main Jan 4, 2022
@prescod prescod deleted the feature/ordered-sets branch January 4, 2022 19:22
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.

3 participants