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

DOP-4571: migration script for bad repo branches #1037

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

seungpark
Copy link
Contributor

Stories/Links:

DOP-4571

Notes

  • simple migration logic to update pool.repos_branches for bad branch values
  • set publishOriginalBranchName = true for each branch that meets the criteria:
publishOriginalBranchName is not true
urlSlug === gitBranchName
urlAliases doesn't contain urlSlug
  • concern that master branches will be pushed to mongodb.com/docs/{prefix}/master with this change, but this line seems safe

Copy link

github-actions bot commented May 3, 2024

Your feature branch infrastructure has been deployed!

Your webhook URL is: https://awvmwd9xu9.execute-api.us-east-2.amazonaws.com/prod/webhook/githubEndpoint/trigger/build

For more information on how to use this endpoint, follow these instructions.

@@ -8,7 +8,7 @@ import { ObjectId, Db, Document } from 'mongodb';
import { db as poolDb } from './pool';

// We should only ever have one client active at a time.
const atlasURL = `mongodb+srv://${process.env.MONGO_ATLAS_USERNAME}:${process.env.MONGO_ATLAS_PASSWORD}@${process.env.MONGO_ATLAS_HOST}/?retryWrites=true&w=majority&maxPoolSize=20`;
const atlasURL = `mongodb://${process.env.MONGO_ATLAS_HOST}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change was for local dev. not important :)

@seungpark seungpark marked this pull request as ready for review May 3, 2024 15:06
Copy link
Contributor

@rayangler rayangler left a comment

Choose a reason for hiding this comment

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

I think this looks good. Can also exist in snooty-scripts if there's value in keeping this long-term

@seungpark
Copy link
Contributor Author

I think this looks good. Can also exist in snooty-scripts if there's value in keeping this long-term

I'll leave this branch open after closing PR (without merge). snooty scripts did not have any dependencies or env setup but it will be good to have for future migrations. Dropping in a ticket for setting up the overhead

Copy link
Collaborator

@caesarbell caesarbell left a comment

Choose a reason for hiding this comment

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

LGTM

@caesarbell
Copy link
Collaborator

caesarbell commented May 3, 2024

Just a tiny question, what is the benefit of having the script within this repo vs having it in snooty-scripts as a playground? NVM, I just saw @rayangler comment above.

@seungpark
Copy link
Contributor Author

ran in pool and pool_test (repos_branches collections)

IN pool_test.repos_branches

updating repo with id 5faaed879505771886986df6 (cloud-docs-osb) for branches master
updating repo with id 5f6aad1682989d521a606363 (docs-bi-connector) for branches v2.5,v2.4,v2.1,v2.0,v2.8,v2.3,v2.2,v2.7,v2.9,v2.6,v1.1
updating repo with id 5fac1ce373a72fca02ec90c5 (docs) for branches v5.2,v5.1,v4.0,v3.6,v3.4,v3.2,v3.0,v2.6,v2.4,v2.2
updating repo with id 6243aa3f0aae3635a59a1150 (docs-atlas-cli) for branches v1.14,v1.13,v1.12,v1.9,v1.6
updating repo with id 5f6aaf5182989d521a606370 (docs-spark-connector) for branches v2.0,v1.1
updating repo with id 627c2c8ac36621843a967e5a (docs-k8s-operator) for branches v1.22,v1.21,v1.20,v1.18,v1.17,v1.10,v1.9,v1.8,v1.7,v1.6,v1.5,v1.4,v1.3,v1.2,v1.1,v0.12,v0.11,v0.10,v0.8,v0.9,v1.0
updating repo with id 5f6aaed282989d521a60636b (docs-mongocli) for branches v1.29,v1.28,v1.27,v1.26,v1.25,v1.24,v1.23,v0.5.0,v0.0.4,v0.0.3,v0.2.0,v0.1.0
updating repo with id 651ee0dd723f30893f27583f (docs-monorepo) for branches master,current
updating repo with id 651ee377723f30893f275842 (docs-monorepo) for branches master
updating repo with id 654a70b024873dc629eef593 (mms-docs) for branches v1.1,v1.2,v1.3,v1.4,v1.5,v1.6,v1.8,v2.0,v3.4,v3.6,v4.0,v4.2,v4.4
updating repo with id 65ca9fc921bac428c01a30a0 (docs-pymongo) for branches master
updating repo with id 65ce7e20beb2aeb9475769de (docs-scala) for branches master
updating repo with id 65e0ddbfbfa6c8240ca9d6c3 (docs-java-rs) for branches master
in pool.repos_branches
updating repo with id 5f6aaf5182989d521a606370 (docs-spark-connector) for branches v2.0,v1.1
updating repo with id 5faaed879505771886986df6 (cloud-docs-osb) for branches master
updating repo with id 5f6aad1682989d521a606363 (docs-bi-connector) for branches v2.5,v2.4,v2.1,v2.0,v2.8,v2.3,v2.2,v2.7,v2.9,v2.6,v1.1
updating repo with id 5f6aaf2282989d521a60636e (docs-node) for branches v6.4
updating repo with id 5fac1ce373a72fca02ec90c5 (docs) for branches v6.3,v4.2,v5.3,v5.2,v5.1,v4.0,v3.6,v3.4,v3.2,v3.0,v2.6,v2.4,v2.2
updating repo with id 5f6aaed282989d521a60636b (docs-mongocli) for branches v1.29,v1.28,v1.27,v1.26,v1.25,v1.24,v1.23,v0.5.0,v0.0.4,v0.0.3,v0.2.0,v0.1.0
updating repo with id 6243aa3f0aae3635a59a1150 (docs-atlas-cli) for branches v1.20,v1.19,v1.18,v1.17,v1.16,v1.15,v1.14,v1.13,v1.12,v1.9,v1.6
updating repo with id 627c2c8ac36621843a967e5a (docs-k8s-operator) for branches v1.22,v1.21,v1.20,v1.18,v1.17,v1.10,v1.9,v1.8,v1.7,v1.6,v1.5,v1.4,v1.3,v1.2,v1.1,v0.12,v0.11,v0.10,v0.8,v0.9,v1.0
updating repo with id 6320e079d53f9cfa2249ec73 (docs-csharp) for branches v2.24
updating repo with id 654a8421e78cea20bd3833e6 (mms-docs) for branches v1.1,v1.2,v1.3,v1.4,v1.5,v1.6,v1.8,v2.0,v3.4,v3.6,v4.0,v4.2,v4.4
finished

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants