Repository navigation
Conversation
MysticatBot
left a comment
There was a problem hiding this comment.
Hey @dipratap,
⚠ Degraded review - no spec document was found for this change (searched the PR links, the touched repos' docs, the architecture/guidelines docs, and linked Jira). This review covers code-level quality but could not validate the change against an agreed design, so confidence is reduced. Add a spec link (PR template section 4) and re-request review for a full-confidence pass.
Verdict: Request changes - the new metadata keys break an existing unit test, so CI is red.
Complexity: LOW - small additive change to a shared data-model contract.
Changes: adds the optimize-at-source experiment type, its OAS phases, and four OAS metadata keys to the GeoExperiment model (1 file).
Note: CI checks are currently failing - resolve before merge.
Must fix before merge
- [Important]
METADATA_KEYStest still deep-equals the old 6 keys, and the new type and phases are untested -packages/spacecat-shared-data-access/test/unit/models/geo-experiment/geo-experiment.model.test.js:78(caused by packages/spacecat-shared-data-access/src/models/geo-experiment/geo-experiment.model.js:95) (details inline)
Non-blocking (2): minor issues and suggestions
- nit: the
@typeJSDoc forMETADATA_KEYSstill lists only the original 6 keys - addDEPLOYED_URLS,PUBLISH_CHECK,POST_WINDOW,SNAPSHOTS_LOCATION-packages/spacecat-shared-data-access/src/models/geo-experiment/geo-experiment.model.js:75 - suggestion:
deployedUrls(URLs from an external UI that a worker will later fetch) andsnapshotsLocation(an S3 key) are only checked byisObject(metadata). Consider a small exported validator, like the existing../://guard on insights locations. -packages/spacecat-shared-data-access/src/models/geo-experiment/geo-experiment.model.js:97
Open design questions (1): not blocking
allActive()filters on status only, so OAS experiments will reach any consumer that does not yet route ontype. Is the rollout planned as engine first, then the API writer? Or shouldallActive()accept a type filter? -packages/spacecat-shared-data-access/src/models/geo-experiment/geo-experiment.collection.js:50
Skill: pr-review | Model: us.anthropic.claude-opus-5-5[1m] | Duration: 0m 50s | Cost: $3.45 | Commit: 5dac752f909e6500ec5f500b6a0d903fbb048e77
If this code review was useful, please react with 👍. Otherwise, react with 👎.
| OAE_VALIDATION_JOBS: 'oaeValidationJobs', | ||
| // Baseline (window 0) measurement bookkeeping, e.g. { taskId, startedAt, retryCount }. | ||
| BASELINE_MEASUREMENT: 'baselineMeasurement', | ||
| // optimize-at-source bookkeeping. |
There was a problem hiding this comment.
issue (blocking): These four new METADATA_KEYS break exposes METADATA_KEYS constant (test/unit/models/geo-experiment/geo-experiment.model.test.js:78-87). That test deep-equals the old 6-key object, so the Test job fails with expected { ...(10) } to deeply equal { ...(6) }. No test covers the other new values either:
TYPES.OPTIMIZE_AT_SOURCE(line 25) is the only runtime behavior change here.geo-experiment.schema.jsbuilds thetypeenum fromObject.values(GeoExperiment.TYPES), so the model now acceptsoptimize_at_sourceon create.- The seven
OAS_*phases (lines 52-58) have no assertions.
These strings become a persisted contract between services, and the file already pins the existing phase literals (lines 140-152) to protect them.
Fix:
- add the four new key/value pairs to the expected object at lines 79-86
- add a
setType(GeoExperiment.TYPES.OPTIMIZE_AT_SOURCE)round-trip togets and sets type - add an
exposes the optimize-at-source phasestest that asserts eachOAS_*literal
|
This PR will trigger a minor release when merged. |
Please ensure your pull request adheres to the following guidelines:
Related Issues
Thanks for contributing!