Skip to content

fix(docs/upload): add safeguard if projects have bidi enabled #1175

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

Conversation

emilyskuo
Copy link
Member

@emilyskuo emilyskuo commented Feb 25, 2025

🚥 Resolves RM-11901

🧰 Changes

Adding in a safe guard for ReadMe projects with bidirectional sync enabled, since the docs frontmatter format is different for bidi. By default, rdme docs upload may try to "fix" things and modify the markdown files, which could result in corrupted data and/or syncing errors.

Once https://github.com/readmeio/readme/pull/13869 is merged, we'll be exposing info on the project's bidi connection if it exists via the get project metadata (/projects/me) endpoint. This PR will introduce a check to see if a bidi connection exists, and throw an error if it does. If users want to continue uploading via rdme, they can use the --skip-validation flag to do so without potential issues from rdme's validation & fixing steps.

🧬 QA & Testing

Tested this against https://github.com/readmeio/readme/pull/13869 locally. Added some tests for docs upload as well.

@emilyskuo emilyskuo marked this pull request as ready for review February 28, 2025 22:20
@emilyskuo emilyskuo requested a review from kanadgupta February 28, 2025 22:20
@emilyskuo emilyskuo changed the title chore: add safeguard for docs upload if projects have bidi enabled fix(docs/upload): add safeguard if projects have bidi enabled Feb 28, 2025
Copy link
Member

@kanadgupta kanadgupta left a comment

Choose a reason for hiding this comment

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

a few small outstanding things but this looks great on the whole!

kanadgupta added a commit that referenced this pull request Mar 7, 2025
## 🧰 Changes

this PR updates our APIv2 openapi description as part of @emilyskuo's
work in #1175 and chunks out the OAS into its own dedicated file since
it's absolutely massive. you can check out the diff of the file changes
[here](next...1346b8b).

i tried messing around with JSON module imports so we can eventually
automate these updates more easily, but we lose out on a lot of good
strict typing that we currently have with `as const satisfies
OASDocument`. annoying!

## 🧬 QA & Testing

no functional changes. do tests still pass?
@emilyskuo emilyskuo requested a review from kanadgupta March 11, 2025 23:27
kanadgupta added a commit that referenced this pull request Mar 20, 2025
## 🧰 Changes

updates the readme APIv2 doc. no functional changes, just adding a few
necessary types for #1175!

@emilyskuo i think we can close
#1195 but let me know your thoughts
— i think i'd prefer this change be merged into `next` separately from
#1175!
@emilyskuo emilyskuo merged commit e66b257 into next Mar 31, 2025
8 checks passed
@emilyskuo emilyskuo deleted the emily/rm-11901-add-safeguards-to-rdme-docs-upload-for-users-that-have-bidi branch March 31, 2025 19:35
kanadgupta pushed a commit that referenced this pull request Mar 31, 2025
# [10.2.0-next.8](v10.2.0-next.7...v10.2.0-next.8) (2025-03-31)

### Bug Fixes

* **docs/upload:** add safeguard if projects have bidi enabled ([#1175](#1175)) ([e66b257](e66b257))

[skip ci]
@kanadgupta
Copy link
Member

🎉 This PR is included in version 10.2.0-next.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

kanadgupta pushed a commit that referenced this pull request Apr 29, 2025
# [10.2.0](v10.1.1...v10.2.0) (2025-04-29)

### Bug Fixes

* **docs/upload:** add safeguard if projects have bidi enabled ([#1175](#1175)) ([e66b257](e66b257))
* **docs/upload:** switch from `HEAD` to `GET` for initial page fetch ([#1224](#1224)) ([0e657c6](0e657c6))
* **docs/upload:** upload progress via ora ([#1231](#1231)) ([0549f66](0549f66))
* fetch util types ([#1218](#1218)) ([453efe9](453efe9))
* more copy edits, snapshot changes, fixes to get tests passing ([5755efa](5755efa))
* **openapi/upload:** add warning for unexpected slugs ([55e0974](55e0974))
* **openapi/upload:** improved handling for YAML files ([#1154](#1154)) ([f1e4d16](f1e4d16))
* timeouts on `doc:upload` ([#1227](#1227)) ([a7961ce](a7961ce))
* **v9:** point to correct dist-tag for outdated version notifications ([#1156](#1156)) ([099060d](099060d))

### Features

* `rdme docs upload` ([#1159](#1159)) ([69f9c7e](69f9c7e))
* add `docs migrate` command ([#1220](#1220)) ([67bd2ef](67bd2ef))
* better guides types, expose page stat type for `renderable` status ([#1236](#1236)) ([408253a](408253a))
* **cli:** add support for plugins ([#1213](#1213)) ([004c8bc](004c8bc))
* **docs/migrate:** add ability to unzip archives ([#1226](#1226)) ([334e125](334e125))
* **docs/migrate:** migration stats ([#1230](#1230)) ([ba3f062](ba3f062))
* **docs/upload:** support `.mdx` file extension ([#1198](#1198)) ([89f43fe](89f43fe))
* **docs:** add `--hide-experimental-warning` flag ([#1229](#1229)) ([250e9ce](250e9ce))
* **docs:** add ability to bypass autofix prompt ([#1234](#1234)) ([0407330](0407330))
* expose `readdirRecursive` ([fdf21fa](fdf21fa))
* expose fetch utils ([#1217](#1217)) ([0049a06](0049a06))
* exposing types for creating API keys to plugins ([#1225](#1225)) ([b625d80](b625d80))
* minor tweaks to plugin extensibility ([#1221](#1221)) ([4c72743](4c72743))
* **openapi/upload:** add `--confirm-overwrite` flag ([#1168](#1168)) ([59a913f](59a913f))
* **openapi:** improvements to circular ref detection, validation errors ([#1189](#1189)) ([683320f](683320f))
* **openapi:** improvements to circular ref detection, validation errors ([#1189](#1189)) ([57b732f](57b732f))
* various changes to get us plugin-ready ([#1216](#1216)) ([7cbe12b](7cbe12b))

### Reverts

* don't use v9 release channel in v10 ([db80253](db80253))

[skip ci]
@kanadgupta
Copy link
Member

🎉 This PR is included in version 10.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants