diff --git a/README.md b/README.md index 935ac443f..495e7c77c 100644 --- a/README.md +++ b/README.md @@ -1570,6 +1570,7 @@ The required index definitions for each release can be found at the following re - `2.7` - `2.8` - `2.9` +- `2.10` The indexes specifications are stored in JSON files. The directory structure is: diff --git a/README.md.gotmpl b/README.md.gotmpl index a29b7e76a..3af18059d 100644 --- a/README.md.gotmpl +++ b/README.md.gotmpl @@ -1579,6 +1579,7 @@ The required index definitions for each release can be found at the following re - `2.7` - `2.8` - `2.9` +- `2.10` The indexes specifications are stored in JSON files. The directory structure is: diff --git a/indexes/audit/audit.json b/indexes/audit/audit.json new file mode 100644 index 000000000..5a25b6c9d --- /dev/null +++ b/indexes/audit/audit.json @@ -0,0 +1,73 @@ +[ + { + "key": { + "accountId": 1, + "timestamp": -1 + }, + "name": "accountId_1_timestamp_-1" + }, + { + "key": { + "accountId": 1, + "eventType": 1, + "timestamp": -1 + }, + "name": "accountId_1_eventType_1_timestamp_-1" + }, + { + "key": { + "accountId": 1, + "entityType": 1, + "timestamp": -1 + }, + "name": "accountId_1_entityType_1_timestamp_-1" + }, + { + "key": { + "accountId": 1, + "entityName": 1, + "timestamp": -1 + }, + "name": "accountId_1_entityName_1_timestamp_-1" + }, + { + "key": { + "accountId": 1, + "status": 1, + "timestamp": -1 + }, + "name": "accountId_1_status_1_timestamp_-1" + }, + { + "key": { + "accountId": 1, + "userId": 1, + "timestamp": -1 + }, + "name": "accountId_1_userId_1_timestamp_-1" + }, + { + "key": { + "_id": 1 + }, + "name": "_id_" + }, + { + "key": { + "inactive": 1, + "updatedAt": 1 + }, + "name": "inactive_1_updatedAt_1", + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + } +] diff --git a/indexes/read-models/clusters.json b/indexes/read-models/clusters.json new file mode 100644 index 000000000..7334f3ac4 --- /dev/null +++ b/indexes/read-models/clusters.json @@ -0,0 +1,130 @@ +[ + { + "key": { + "__passiveReferencedBy.name": 1 + } + }, + { + "key": { + "__passiveReferencedBy.name": 1, + "__passiveReferencedBy.kind": 1, + "__passiveReferencedBy.namespace": 1, + "__passiveReferencedBy.group": 1, + "__passiveReferencedBy.version": 1 + } + }, + { + "key": { + "__passiveReferences.name": 1 + } + }, + { + "key": { + "__passiveReferences.name": 1, + "__passiveReferences.kind": 1, + "__passiveReferences.namespace": 1, + "__passiveReferences.group": 1, + "__passiveReferences.version": 1 + } + }, + { + "key": { + "__inferredReferencedBy.name": 1 + } + }, + { + "key": { + "__inferredReferencedBy.name": 1, + "__inferredReferencedBy.kind": 1, + "__inferredReferencedBy.namespace": 1, + "__inferredReferencedBy.group": 1, + "__inferredReferencedBy.version": 1 + } + }, + { + "key": { + "__inferredReferences.name": 1 + } + }, + { + "key": { + "__inferredReferences.name": 1, + "__inferredReferences.kind": 1, + "__inferredReferences.namespace": 1, + "__inferredReferences.group": 1, + "__inferredReferences.version": 1 + } + }, + { + "key": { + "updatedAt": 1 + } + }, + { + "key": { + "projects": 1 + } + }, + { + "key": { + "metadata.name": 1 + } + }, + { + "key": { + "metadata.labels": 1 + } + }, + { + "key": { + "self.name": 1 + } + }, + { + "key": { + "self.name": 1, + "self.kind": 1, + "self.namespace": 1, + "self.group": 1, + "self.version": 1 + } + }, + { + "key": { + "metadata.accountId": 1, + "metadata.runtime": 1, + "server": 1 + }, + "unique": true + }, + { + "key": { + "metadata.accountId": 1, + "metadata.runtime": 1, + "metadata.cluster": 1, + "metadata.namespace": 1, + "metadata.group": 1, + "metadata.version": 1, + "metadata.kind": 1, + "metadata.name": 1 + }, + "unique": true + }, + { + "key": { + "inactive": 1, + "updatedAt": 1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + } +] diff --git a/indexes/read-models/product-releases.json b/indexes/read-models/product-releases.json index 22f5db330..43202e42c 100644 --- a/indexes/read-models/product-releases.json +++ b/indexes/read-models/product-releases.json @@ -92,5 +92,23 @@ "createdAt": 1 }, "expireAfterSeconds": 23328000 + }, + { + "key": { + "accountId": 1, + "createdAt": -1, + "_id": -1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } } ] diff --git a/indexes/read-models/promotion-tasks.json b/indexes/read-models/promotion-tasks.json new file mode 100644 index 000000000..21d19e646 --- /dev/null +++ b/indexes/read-models/promotion-tasks.json @@ -0,0 +1,74 @@ +[ + { + "key": { + "accountId": 1, + "_id": 1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "accountId": 1, + "metadata.promotionId": 1, + "metadata.environment": 1, + "createdAt": -1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "accountId": 1, + "runtimeName": 1, + "spec.phase": 1, + "createdAt": -1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "createdAt": 1 + }, + "expireAfterSeconds": 15552000, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + } +] diff --git a/indexes/read-models/promotions.json b/indexes/read-models/promotions.json index 8206611d6..ba4fac2b2 100644 --- a/indexes/read-models/promotions.json +++ b/indexes/read-models/promotions.json @@ -16,5 +16,76 @@ "normalization": false, "backwards": false } + }, + { + "key": { + "accountId": 1, + "productName": 1, + "triggerCommitInfo.commitSha": 1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "accountId": 1, + "productName": 1, + "createdAt": -1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "createdAt": 1 + }, + "expireAfterSeconds": 15552000, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "accountId": 1, + "createdAt": -1, + "_id": -1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } } ] diff --git a/indexes/read-models/releases.json b/indexes/read-models/releases.json index e83564629..f9086dc7b 100644 --- a/indexes/read-models/releases.json +++ b/indexes/read-models/releases.json @@ -1,138 +1,159 @@ [ - { - "key": { - "applicationMetadata.name": 1 - } - }, - { - "key": { - "applicationMetadata.labels": 1 - } - }, - { - "key": { - "application.prs.type": 1 - } - }, - { - "key": { - "application.prs.key": 1 - } - }, - { - "key": { - "application.prs.accountId": 1 - } - }, - { - "key": { - "application.issues.type": 1 - } - }, - { - "key": { - "application.issues.key": 1 - } - }, - { - "key": { - "application.issues.accountId": 1 - } - }, - { - "key": { - "applicationMetadata.accountId": 1, - "applicationMetadata.runtime": 1, - "applicationMetadata.name": 1, - "applicationMetadata.namespace": 1, - "application.issues.key": 1 - } - }, - { - "key": { - "applicationMetadata.accountId": 1, - "applicationMetadata.runtime": 1, - "applicationMetadata.name": 1, - "applicationMetadata.namespace": 1, - "application.prs.key": 1 - } - }, - { - "key": { - "applicationMetadata.accountId": 1, - "applicationMetadata.runtime": 1, - "applicationMetadata.name": 1, - "applicationMetadata.namespace": 1, - "application.committers.userName": 1 - } - }, - { - "key": { - "applicationMetadata.accountId": 1, - "applicationMetadata.runtime": 1, - "applicationMetadata.name": 1, - "applicationMetadata.namespace": 1, - "applicationMetadata.group": 1, - "applicationMetadata.version": 1, - "applicationMetadata.kind": 1, - "historyId": -1 - }, - "unique": true - }, - { - "key": { - "applicationMetadata.accountId": 1, - "applicationMetadata.runtime": 1, - "applicationMetadata.name": 1, - "applicationMetadata.namespace": 1, - "applicationMetadata.group": 1, - "applicationMetadata.version": 1, - "reportedToJira": 1, - "historyId": 1, - "application.status.syncStartedAt": 1 - } - }, - { - "key": { - "fromState.services.revision": 1, - "fromState.services.name": 1, - "applicationMetadata.accountId": 1 - } - }, - { - "key": { - "syncOperationRevision": 1, - "applicationMetadata.name": 1, - "applicationMetadata.accountId": 1, - "historyId": -1 - } - }, - { - "key": { - "applicationMetadata.name": 1, - "applicationMetadata.accountId": 1, - "historyId": -1 - } - }, - { - "key": { - "applicationMetadata.name": 1, - "applicationMetadata.accountId": 1, - "application.status.healthStatus": 1 - } - }, - { - "key": { - "applicationMetadata.name": 1, - "applicationMetadata.accountId": 1, - "current": 1 - } - }, - { - "key": { - "application.status.revision": 1, - "applicationMetadata.name": 1, - "applicationMetadata.accountId": 1 - } + { + "key": { + "applicationMetadata.name": 1 + } + }, + { + "key": { + "applicationMetadata.labels": 1 + } + }, + { + "key": { + "application.prs.type": 1 + } + }, + { + "key": { + "application.prs.key": 1 + } + }, + { + "key": { + "application.prs.accountId": 1 + } + }, + { + "key": { + "application.issues.type": 1 + } + }, + { + "key": { + "application.issues.key": 1 + } + }, + { + "key": { + "application.issues.accountId": 1 + } + }, + { + "key": { + "applicationMetadata.accountId": 1, + "applicationMetadata.runtime": 1, + "applicationMetadata.name": 1, + "applicationMetadata.namespace": 1, + "application.issues.key": 1 + } + }, + { + "key": { + "applicationMetadata.accountId": 1, + "applicationMetadata.runtime": 1, + "applicationMetadata.name": 1, + "applicationMetadata.namespace": 1, + "application.prs.key": 1 + } + }, + { + "key": { + "applicationMetadata.accountId": 1, + "applicationMetadata.runtime": 1, + "applicationMetadata.name": 1, + "applicationMetadata.namespace": 1, + "application.committers.userName": 1 + } + }, + { + "key": { + "applicationMetadata.accountId": 1, + "applicationMetadata.runtime": 1, + "applicationMetadata.name": 1, + "applicationMetadata.namespace": 1, + "applicationMetadata.group": 1, + "applicationMetadata.version": 1, + "applicationMetadata.kind": 1, + "historyId": -1 + }, + "unique": true + }, + { + "key": { + "applicationMetadata.accountId": 1, + "applicationMetadata.runtime": 1, + "applicationMetadata.name": 1, + "applicationMetadata.namespace": 1, + "applicationMetadata.group": 1, + "applicationMetadata.version": 1, + "reportedToJira": 1, + "historyId": 1, + "application.status.syncStartedAt": 1 + } + }, + { + "key": { + "fromState.services.revision": 1, + "fromState.services.name": 1, + "applicationMetadata.accountId": 1 + } + }, + { + "key": { + "syncOperationRevision": 1, + "applicationMetadata.name": 1, + "applicationMetadata.accountId": 1, + "historyId": -1 + } + }, + { + "key": { + "applicationMetadata.name": 1, + "applicationMetadata.accountId": 1, + "historyId": -1 + } + }, + { + "key": { + "applicationMetadata.name": 1, + "applicationMetadata.accountId": 1, + "application.status.healthStatus": 1 + } + }, + { + "key": { + "applicationMetadata.name": 1, + "applicationMetadata.accountId": 1, + "current": 1 + } + }, + { + "key": { + "application.status.revision": 1, + "applicationMetadata.name": 1, + "applicationMetadata.accountId": 1 + } + }, + { + "key": { + "applicationMetadata.accountId": 1, + "applicationMetadata.name": 1, + "applicationMetadata.runtime": 1, + "historyId": -1 + } + }, + { + "key": { + "applicationMetadata.timestamp": 1, + "_id": 1 + } + }, + { + "key": { + "applicationMetadata.accountId": 1, + "applicationMetadata.cluster": 1, + "applicationMetadata.runtime": 1 } + } ] diff --git a/indexes/read-models/runtimes.json b/indexes/read-models/runtimes.json new file mode 100644 index 000000000..725921a1a --- /dev/null +++ b/indexes/read-models/runtimes.json @@ -0,0 +1,207 @@ +[ + { + "key": { + "projects": 1 + } + }, + { + "key": { + "referencedBy.name": 1 + } + }, + { + "key": { + "references.name": 1 + } + }, + { + "key": { + "metadata.name": 1 + } + }, + { + "key": { + "metadata.labels": 1 + } + }, + { + "key": { + "metadata.accountId": 1 + } + }, + { + "key": { + "self.name": 1 + } + }, + { + "key": { + "self.name": 1, + "self.kind": 1, + "self.namespace": 1, + "self.group": 1, + "self.version": 1 + } + }, + { + "key": { + "runtimeVersion": 1 + } + }, + { + "key": { + "metadata.accountId": 1, + "metadata.name": 1 + }, + "unique": true + }, + { + "key": { + "__passiveReferencedBy.name": 1 + } + }, + { + "key": { + "__passiveReferencedBy.name": 1, + "__passiveReferencedBy.kind": 1, + "__passiveReferencedBy.namespace": 1, + "__passiveReferencedBy.group": 1, + "__passiveReferencedBy.version": 1 + } + }, + { + "key": { + "__passiveReferences.name": 1 + } + }, + { + "key": { + "__passiveReferences.name": 1, + "__passiveReferences.kind": 1, + "__passiveReferences.namespace": 1, + "__passiveReferences.group": 1, + "__passiveReferences.version": 1 + } + }, + { + "key": { + "__inferredReferencedBy.name": 1 + } + }, + { + "key": { + "__inferredReferencedBy.name": 1, + "__inferredReferencedBy.kind": 1, + "__inferredReferencedBy.namespace": 1, + "__inferredReferencedBy.group": 1, + "__inferredReferencedBy.version": 1 + } + }, + { + "key": { + "__inferredReferences.name": 1 + } + }, + { + "key": { + "__inferredReferences.name": 1, + "__inferredReferences.kind": 1, + "__inferredReferences.namespace": 1, + "__inferredReferences.group": 1, + "__inferredReferences.version": 1 + } + }, + { + "key": { + "updatedAt": 1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "inactive": 1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "metadata.accountId": 1, + "metadata.runtime": 1, + "metadata.name": 1, + "metadata.namespace": 1, + "ingressHost": 1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "metadata.accountId": 1, + "metadata.runtime": 1, + "metadata.cluster": 1, + "metadata.namespace": 1, + "metadata.group": 1, + "metadata.version": 1, + "metadata.kind": 1, + "metadata.name": 1 + }, + "unique": true, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + }, + { + "key": { + "inactive": 1, + "updatedAt": 1 + }, + "collation": { + "locale": "en_US", + "caseLevel": false, + "caseFirst": "off", + "strength": 1, + "numericOrdering": false, + "alternate": "non-ignorable", + "maxVariable": "punct", + "normalization": false, + "backwards": false + } + } +]