-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: blueprint config fixup step SOFIE-2258 #1050
Conversation
# Conflicts: # packages/blueprints-integration/src/context/index.ts
fcc4836
to
ccdf14b
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## release51 #1050 +/- ##
=============================================
- Coverage 58.05% 57.95% -0.11%
=============================================
Files 485 501 +16
Lines 78987 80375 +1388
Branches 4130 4248 +118
=============================================
+ Hits 45855 46580 +725
- Misses 33077 33741 +664
+ Partials 55 54 -1
☔ View full report in Codecov by Sentry. |
…fig-upgrade-step # Conflicts: # meteor/client/ui/Settings/ShowStyle/BlueprintConfiguration/index.tsx # meteor/client/ui/Settings/Studio/BlueprintConfiguration/index.tsx # meteor/client/ui/Settings/Upgrades/Components.tsx # meteor/lib/api/migration.ts # meteor/lib/api/upgradeStatus.ts # meteor/server/migration/api.ts # meteor/server/publications/blueprintUpgradeStatus/checkStatus.ts # meteor/server/publications/blueprintUpgradeStatus/publication.ts # meteor/server/publications/blueprintUpgradeStatus/reactiveContentCache.ts # meteor/server/systemStatus/__tests__/systemStatus.test.ts
# Conflicts: # meteor/client/ui/Settings/ShowStyle/BlueprintConfiguration/index.tsx # meteor/client/ui/Settings/Studio/BlueprintConfiguration/index.tsx # meteor/client/ui/Settings/Upgrades/Components.tsx # meteor/lib/api/migration.ts # meteor/lib/api/upgradeStatus.ts # meteor/server/migration/api.ts # meteor/server/publications/blueprintUpgradeStatus/checkStatus.ts # meteor/server/publications/blueprintUpgradeStatus/publication.ts # meteor/server/publications/blueprintUpgradeStatus/reactiveContentCache.ts # meteor/server/systemStatus/__tests__/systemStatus.test.ts
|
||
export async function validateConfigForShowStyleBase( | ||
export async function fixupConfigForShowStyleBase( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the studio config fixup step ran from the worker whereas the showstyle step is ran from meteor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the pattern I started with the other config methods.
I am not 100% sold on it anymore, but my original justification was that we have the job-worker which handles the studio, and doing it there will avoid needing to load the studio blueprints in meteor.
But a showstyle can be used by multiple studios, so can't be pushed to the job-worker currently.
feature
This builds on #1049
I am not entirely convinced by the naming, so am open to suggestions on a better name
When using the new blueprint config upgrade flow #808 instead of the old migrations flow, it is not possible to handle restructuring of the config without some external tooling or manual fixup of the data.
It is now possible to provide a method to perform some fixup of the users configuration overrides.
This method is optional, and if defined must be run after uploading blueprints before the config can be edited or re-validated.
It has been added as an explicit step as it has the ability to show warning messages to the user, some of which might need manual addressing. It is also possible to ignore/skip the run of fixupConfig, intended to be an escape hatch in case the fixupConfig function gets stuck in an error loop.
This utilises the changed from #1049 for this, so that the fixup function can be triggered from both the blueprint config page, and from the main migrations page. When the fixup needs running, the configuration section is hidden, to ensure changes are not made.
Once run, it is possible to edit configuration and apply/validate the config as usual.
Because this is modifying an object which is of type
ObjectWithOverrides<T>
, we don't want to expose it directly to the blueprints. In particular, we don't want to expose every type of operation as that will make it more breaking when we modify/add more operation types. Instead we provide an abstract view of this via the context.This means the blueprints are aware that the key identifiers are paths, but they must perform mutations via function calls so that we can update the overrides correctly.
Some examples of things that could be done.
Fix a typo in a property name
Status