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

Deprecate Old publishedOn and ownedBy GraphQL Fields (Instead of Removing Them) and Make New Meta GraphQL Fields Nullable #4156

Merged
merged 82 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
cfd5291
fix: add `--data-migration-logs` flag in order to optionally hide mig…
adrians5j May 15, 2024
4f13ca0
fix: remove default logger
adrians5j May 15, 2024
a0d465c
fix: remove extra dashes
adrians5j May 15, 2024
a4220a1
fix: change `--data-migration-logs` to `-data-migration-reporter`
adrians5j May 15, 2024
cdab323
fix: toggle data migration log streaming via `WEBINY_MIGRATION_LOG_ST…
adrians5j May 16, 2024
f2637f0
Merge remote-tracking branch 'refs/remotes/origin/dev' into adrian/mi…
adrians5j May 16, 2024
85ef4d9
fix: toggle data migration log streaming via `WEBINY_MIGRATION_LOG_ST…
adrians5j May 16, 2024
c5e7026
fix: export `VoidStatusReporter` from `cli/index.ts`
adrians5j May 16, 2024
8283006
fix: create a migration script that can be run manually
adrians5j May 22, 2024
88077e0
Merge remote-tracking branch 'refs/remotes/origin/dev' into adrian/mi…
adrians5j May 22, 2024
ddd2a70
wip: create a migration script that can be run manually
adrians5j May 23, 2024
bb312b9
Merge remote-tracking branch 'refs/remotes/origin/dev' into adrian/mi…
adrians5j May 23, 2024
53fccf7
fix: create a migration script that can be run manually
adrians5j May 23, 2024
067cb0c
fix: add `elasticsearchDynamoToElasticLambdaName`
adrians5j May 23, 2024
3cd14fd
fix(api-elasticsearch): provide reason for waiting healthy cluster
brunozoric May 23, 2024
0542ec4
fix: create a migration script that can be run manually
adrians5j May 24, 2024
a7b48da
Merge remote-tracking branch 'origin/adrian/migration-script-using-mt…
adrians5j May 24, 2024
195535e
fix: create a migration script that can be run manually
adrians5j May 24, 2024
48a90d3
fix: create a migration script that can be run manually
adrians5j May 24, 2024
3e1eb41
fix: update deps
adrians5j May 24, 2024
284101d
fix: rename class
adrians5j May 24, 2024
6f7b9d4
fix: rename class
adrians5j May 24, 2024
3aafac3
fix: remove testing script
adrians5j May 24, 2024
9463bb9
chore: temporary push delete script
adrians5j May 29, 2024
5b63430
chore: add ES health checks stats
adrians5j May 29, 2024
ed4a7dd
fix(api-headless-cms): mock data generator (#4147)
brunozoric Jun 3, 2024
887d1ff
chore: add ES health checks stats
adrians5j Jun 3, 2024
3635889
Merge branch 'adrian/migration-script-using-mt' of github.com:webiny/…
adrians5j Jun 3, 2024
520ed32
fix(api-dynamodb-to-elasticsearch): max waiting time [skip ci]
brunozoric Jun 4, 2024
d581785
chore: create revert meta fields script
adrians5j Jun 4, 2024
657e322
Merge branch 'adrian/migration-script-using-mt' of github.com:webiny/…
adrians5j Jun 4, 2024
8ae0fa8
chore: create revert meta fields script
adrians5j Jun 4, 2024
c7e95ea
chore: create revert meta fields script
adrians5j Jun 4, 2024
d97a507
chore: create revert meta fields script
adrians5j Jun 4, 2024
897133a
chore: create revert meta fields script
adrians5j Jun 4, 2024
8591d64
fix(api-headless-cms-es-tasks): add create index [skip ci]
brunozoric Jun 5, 2024
746bfa2
chore: remove temp scripts
adrians5j Jun 5, 2024
3f17cf0
chore: remove temp scripts
adrians5j Jun 5, 2024
c3696ea
chore: add migration files
adrians5j Jun 5, 2024
202dfa1
chore: remove migration files
adrians5j Jun 5, 2024
07e3365
Merge branch 'refs/heads/adrian/migration-script-using-mt' into adria…
adrians5j Jun 5, 2024
0d2934b
chore: add migration files
adrians5j Jun 5, 2024
6683c99
chore: update deps
adrians5j Jun 6, 2024
ca76f49
Merge branch 'refs/heads/adrian/migration-script-using-mt' into adria…
adrians5j Jun 6, 2024
d784e08
chore: update deps
adrians5j Jun 6, 2024
aadffb0
Merge branch 'dev' into adrian/migration-script-using-mt
adrians5j Jun 6, 2024
8499e1a
fix: add migration skipped ddb entry
adrians5j Jun 6, 2024
d28ad57
fix: remove WEBINY_MIGRATION_RUN_5_39_6_META_FIELDS_DATA_MIGRATIONS
adrians5j Jun 6, 2024
a1d7cf3
fix: bring back `publishedOn` and `ownedBy` GQL fields, make new GQL …
adrians5j Jun 6, 2024
75aae49
Merge branch 'adrian/migration-script-using-mt' into adrian/migration…
adrians5j Jun 6, 2024
bc77f16
fix: move `api-dynamodb-to-elasticsearch` into `ddb-es` / `ddb-os` tests
adrians5j Jun 6, 2024
5833b21
fix: move `api-dynamodb-to-elasticsearch` into `ddb-es` / `ddb-os` tests
adrians5j Jun 6, 2024
aec8e9b
Merge remote-tracking branch 'origin/adrian/migration-script-using-mt…
adrians5j Jun 6, 2024
d71a0e5
Merge branch 'adrian/migration-script-using-mt' into adrian/migration…
adrians5j Jun 6, 2024
9b4be7b
Merge branch 'adrian/migration-script-using-mt-2' into adrian/depreca…
adrians5j Jun 6, 2024
3a17b14
Merge branch 'adrian/migration-script-using-mt-2' of github.com:webin…
adrians5j Jun 6, 2024
fe844c7
Merge branch 'adrian/migration-script-using-mt-2' into adrian/depreca…
adrians5j Jun 6, 2024
5c67559
chore: skip prepublish build if `WEBINY_SERVERLESS_CMS_AWS_SKIP_PREPU…
adrians5j Jun 6, 2024
09f0caa
fix: move `api-headless-cms-es-tasks` into `ddb-es` / `ddb-os` tests
adrians5j Jun 6, 2024
20e73c0
chore: remove `private: true`
adrians5j Jun 6, 2024
4bcfdec
Merge branch 'adrian/migration-script-using-mt' into adrian/migration…
adrians5j Jun 6, 2024
23071d5
chore: remove `private: true`cxzzxczxc
adrians5j Jun 6, 2024
62becf8
chore: remove `private: true`cxzzxczxc
adrians5j Jun 6, 2024
a16d54b
Merge branch 'adrian/migration-script-using-mt' into adrian/migration…
adrians5j Jun 6, 2024
5e295af
Merge branch 'adrian/migration-script-using-mt-2' into adrian/depreca…
adrians5j Jun 6, 2024
32482c2
chore: run prettier
adrians5j Jun 7, 2024
0abcb9d
Merge remote-tracking branch 'origin/adrian/deprecated-gql-meta-field…
adrians5j Jun 7, 2024
ade6e03
fix: github workflows
brunozoric Jun 7, 2024
2079fef
fix: github workflows
brunozoric Jun 7, 2024
9226e11
ci: fix list of packages
adrians5j Jun 7, 2024
59a432d
Merge branch 'adrian/migration-script-using-mt' into adrian/migration…
adrians5j Jun 7, 2024
7dcc365
Merge branch 'adrian/migration-script-using-mt-2' into adrian/depreca…
adrians5j Jun 7, 2024
3c7a80d
fix(api-headless-cms-ddb-es): more detailed error log
brunozoric Jun 7, 2024
952b3e0
test: increase timeout
adrians5j Jun 7, 2024
69bbfec
test: increase timeout
adrians5j Jun 7, 2024
5ce095a
Merge remote-tracking branch 'origin/adrian/migration-script-using-mt…
adrians5j Jun 7, 2024
21d38f6
Merge branch 'adrian/migration-script-using-mt' into adrian/migration…
adrians5j Jun 7, 2024
c1a0798
Merge branch 'adrian/migration-script-using-mt-2' into adrian/depreca…
adrians5j Jun 7, 2024
e7c1719
Merge branch 'dev' into adrian/deprecated-gql-meta-fields
adrians5j Jun 7, 2024
5073c41
test: update GQL snapshots
adrians5j Jun 7, 2024
dc9764b
Merge remote-tracking branch 'origin/adrian/deprecated-gql-meta-field…
adrians5j Jun 7, 2024
97c46d5
test: update GQL snapshots
adrians5j Jun 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,34 @@ export default /* GraphQL */ `
id: ID!
entryId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

meta: CategoryApiNameWhichIsABitDifferentThanModelIdMeta
title: String
slug: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,34 @@ export default /* GraphQL */ `
entryId: String!
modelId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

title: String
slug: String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,34 @@ export default /* GraphQL */ `
id: ID!
entryId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

meta: PageModelApiNameMeta
content: [PageModelApiName_Content!]
header: PageModelApiName_Header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,34 @@ export default /* GraphQL */ `
entryId: String!
modelId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

content: [PageModelApiName_Content!]
header: PageModelApiName_Header
objective: PageModelApiName_Objective
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,34 @@ export default /* GraphQL */ `
id: ID!
entryId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

meta: ProductApiSingularMeta
title: String
category: RefField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,34 @@ export default /* GraphQL */ `
entryId: String!
modelId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

title: String
category(populate: Boolean = true): CategoryApiNameWhichIsABitDifferentThanModelId
price: Number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,34 @@ export default /* GraphQL */ `
id: ID!
entryId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

meta: ReviewApiModelMeta
text: String
product: RefField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,34 @@ export default /* GraphQL */ `
entryId: String!
modelId: String!

createdOn: DateTime!
createdOn: DateTime
modifiedOn: DateTime
savedOn: DateTime!
savedOn: DateTime
firstPublishedOn: DateTime
lastPublishedOn: DateTime
createdBy: CmsIdentity!
createdBy: CmsIdentity
modifiedBy: CmsIdentity
savedBy: CmsIdentity!
savedBy: CmsIdentity
firstPublishedBy: CmsIdentity
lastPublishedBy: CmsIdentity
revisionCreatedOn: DateTime!
revisionCreatedOn: DateTime
revisionModifiedOn: DateTime
revisionSavedOn: DateTime!
revisionSavedOn: DateTime
revisionFirstPublishedOn: DateTime
revisionLastPublishedOn: DateTime
revisionCreatedBy: CmsIdentity!
revisionCreatedBy: CmsIdentity
revisionModifiedBy: CmsIdentity
revisionSavedBy: CmsIdentity!
revisionSavedBy: CmsIdentity
revisionFirstPublishedBy: CmsIdentity
revisionLastPublishedBy: CmsIdentity

publishedOn: DateTime
@deprecated(
reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field."
)
ownedBy: CmsIdentity
@deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

text: String
product(populate: Boolean = true): ProductApiSingular
rating: Number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getEntryDescription } from "~/utils/getEntryDescription";
import { getEntryImage } from "~/utils/getEntryImage";
import { entryFieldFromStorageTransform } from "~/utils/entryStorage";
import { Resolvers } from "@webiny/handler-graphql/types";
import { ENTRY_META_FIELDS, isNullableEntryMetaField, isDateTimeEntryMetaField } from "~/constants";
import { ENTRY_META_FIELDS, isDateTimeEntryMetaField } from "~/constants";

interface EntriesByModel {
[key: string]: string[];
Expand Down Expand Up @@ -321,10 +321,9 @@ export const createContentEntriesSchema = ({
}

const onByMetaFields = ENTRY_META_FIELDS.map(field => {
const isNullable = isNullableEntryMetaField(field) ? "" : "!";
const fieldType = isDateTimeEntryMetaField(field) ? "DateTime" : "CmsIdentity";

return `${field}: ${fieldType}${isNullable}`;
return `${field}: ${fieldType}`;
}).join("\n");

const plugin = new CmsGraphQLSchemaPlugin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { renderGetFilterFields } from "~/utils/renderGetFilterFields";
import { renderInputFields } from "~/utils/renderInputFields";
import { renderFields } from "~/utils/renderFields";
import { CmsGraphQLSchemaSorterPlugin } from "~/plugins";
import { ENTRY_META_FIELDS, isDateTimeEntryMetaField, isNullableEntryMetaField } from "~/constants";
import { ENTRY_META_FIELDS, isDateTimeEntryMetaField } from "~/constants";

interface CreateManageSDLParams {
models: CmsModel[];
Expand Down Expand Up @@ -70,10 +70,9 @@ export const createManageSDL: CreateManageSDL = ({
}).join("\n");

const onByMetaGqlFields = ENTRY_META_FIELDS.map(field => {
const isNullable = isNullableEntryMetaField(field) ? "" : "!";
const fieldType = isDateTimeEntryMetaField(field) ? "DateTime" : "CmsIdentity";

return `${field}: ${fieldType}${isNullable}`;
return `${field}: ${fieldType}`;
}).join("\n");

// Had to remove /* GraphQL */ because prettier would not format the code correctly.
Expand All @@ -85,6 +84,9 @@ export const createManageSDL: CreateManageSDL = ({

${onByMetaGqlFields}

publishedOn: DateTime @deprecated(reason: "Field was removed with the 5.39.0 release. Use 'firstPublishedOn' or 'lastPublishedOn' field.")
ownedBy: CmsIdentity @deprecated(reason: "Field was removed with the 5.39.0 release. Use 'createdBy' field.")

meta: ${singularName}Meta
${fields.map(f => f.fields).join("\n")}
# Advanced Content Organization - make required in 5.38.0
Expand Down
Loading