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

feat: LEAP-1341: Build schema.json in create-docs script #6263

Merged
merged 17 commits into from
Sep 11, 2024

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Aug 27, 2024

Two goals here:

Add script to generate schema.json used for autocomplete in config editor

Format is defined by codemirror's plugin show-hint.
Path to the file is defined by SCHEMA_JSON_PATH env var (see a657eb5)
File will be generated in "Build Frontend" CI step every time when we have changes to tag JSDocs.

Fix small issues in a code for new Video timeline spans

Typos, unused styles, outdated comment in docs

PR fulfills these requirements

  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Describe the reason for change

We need to update autosuggestions in config editor every time we make changes to tags documentation, so they will be in sync.

It's used for autocomplete in config editor.
Format is defined by codemirror's plugin `show-hint`.
@github-actions github-actions bot added the feat label Aug 27, 2024
Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit a5942b4
🔍 Latest deploy log https://app.netlify.com/sites/heartex-docs/deploys/66e04957bdac7900083f257d

Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit a5942b4
🔍 Latest deploy log https://app.netlify.com/sites/label-studio-docs-new-theme/deploys/66e04957fd2c6b000864c444

@hlomzik
Copy link
Collaborator Author

hlomzik commented Sep 9, 2024

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/ui/tsconfig.spec.json

hlomzik and others added 11 commits September 9, 2024 22:06
1. Switch to direct run `nx docs editor` instead of `nx run-many`,
   because we only have `docs` target in editor; it's faster and less confusing
2. Accept path to `schema.json` from env var `SCHEMA_JSON_PATH`:
   - no hardcoded value, configurable on a correct level
   - if no var is provided we just don't generate schema.json
   - this path can also be provided as a 2nd arg for create-docs just in case
3. Apply linting to schema.json, so it won't be rejected by biome check later
   - biome is applied directly in package.json command, so any usage will have a correct file
   - `;` after env var set is required to use it in the command in the same line
@hlomzik
Copy link
Collaborator Author

hlomzik commented Sep 10, 2024

@ellipsis-dev review this

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to a5942b4 in 45 seconds

More details
  • Looked at 709 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. web/apps/labelstudio/src/pages/CreateProject/Config/schema.json:292
  • Draft comment:
    The type for horizontalAlignment should be "string" instead of ["left", "center", "right"]. This applies to verticalAlignment, defaultZoom, and crossOrigin as well. The type should be "string" for these attributes.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The change in the diff to use arrays of specific strings for these attributes seems intentional to enforce stricter validation. The comment suggests reverting this change, which might not align with the intended functionality. The comment does not provide a compelling reason to revert the change, and the new type seems to provide better validation.
    I might be missing the context of why the comment suggests reverting to 'string'. It could be due to a misunderstanding of the intended functionality or a lack of clarity in the diff about why the change was made.
    The change to use arrays of specific strings is likely to enforce stricter validation, which is generally a good practice. Without a clear reason to revert, the comment seems unnecessary.
    The comment should be removed as the change to use arrays of specific strings for these attributes seems intentional and beneficial for validation purposes.
2. web/libs/editor/src/components/Timeline/Views/Frames/Keypoints.tsx:34
  • Draft comment:
    Typo: firtsPoint should be firstPoint.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is about a change made in the diff, specifically a typo correction. The typo has already been corrected in the PR, so the comment is not necessary anymore. The comment does not suggest any further action or improvement beyond what has already been done.
    I might be overlooking the importance of acknowledging typo corrections, but since the typo is already fixed, the comment doesn't add value.
    Acknowledging typo corrections is not necessary if the correction is already made in the PR. The focus should be on unresolved issues or improvements.
    The comment should be removed because the typo has already been corrected in the PR, making the comment redundant.
3. web/apps/labelstudio/src/pages/CreateProject/Config/schema.json:1259
  • Draft comment:
    The type for snap should be "string" instead of ["pixel", "none"]. This applies to other similar attributes as well.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_FFWZ5SeDKP4j349D


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

6 days left in your free trial, upgrade for $20/seat/month or contact us.

@hlomzik hlomzik enabled auto-merge (squash) September 11, 2024 00:19
@hlomzik hlomzik merged commit 8c71573 into develop Sep 11, 2024
41 checks passed
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.

4 participants