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(studio,web): rename testimonial field #169

Merged
merged 2 commits into from
Jan 26, 2025

Conversation

mheob
Copy link
Owner

@mheob mheob commented Jan 26, 2025

closes #162

Summary by CodeRabbit

  • CI/CD Updates

    • Added SonarCloud scan to GitHub Actions workflow
    • Updated GitHub Actions workflow to use new dependency installation method
  • Schema Changes

    • Renamed showAlways field to show in testimonial document type
    • Updated field description and title for testimonial display
  • Type Updates

    • Adjusted type definitions to reflect testimonial field renaming
  • Node.js

    • Updated Node.js version to 22.13.1

@mheob mheob added enhancement New feature or request frontend Belongs to the Next.js App studio Belongs to the Sanity Studio labels Jan 26, 2025
Copy link

height bot commented Jan 26, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

vercel bot commented Jan 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsg-irlich-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2025 0:02am
tsg-irlich-web-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 26, 2025 0:02am

Copy link

coderabbitai bot commented Jan 26, 2025

Walkthrough

The pull request involves renaming the showAlways field to show across multiple files in the project. This change primarily affects the Sanity schema for testimonials, updating the field name in the schema definition, type definitions, and query files. Additionally, the workflow configurations for GitHub Actions have been modified, with updates to dependency installation commands and the addition of a SonarCloud scan step. A minor update to the Node.js version in the package.json file was also made.

Changes

File Change Summary
.github/workflows/check.yml Added global installation of @antfu/ni, changed dependency installation to nci, updated build command to nlx turbo build lint
.github/workflows/sonar.yml Added SonarCloud Scan step using SonarSource/sonarcloud-github-action@master
apps/studio/schema.json Renamed showAlways attribute to show in testimonial document type
apps/studio/schemas/documents/testimonial.ts Renamed field from showAlways to show, updated title and description
apps/web/src/lib/sanity/queries/pages/home.ts Replaced showAlways with show in homePageTestimonialsQuery
apps/web/src/types/sanity.types.generated.ts Updated type definitions to replace showAlways with show
package.json Updated Node.js version from 22.13.0 to 22.13.1

Assessment against linked issues

Objective Addressed Explanation
Rename "Zitat immer anzeigen" field [#162]

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87872d9 and 17f7959.

📒 Files selected for processing (7)
  • .github/workflows/check.yml (1 hunks)
  • .github/workflows/sonar.yml (1 hunks)
  • apps/studio/schema.json (1 hunks)
  • apps/studio/schemas/documents/testimonial.ts (1 hunks)
  • apps/web/src/lib/sanity/queries/pages/home.ts (1 hunks)
  • apps/web/src/types/sanity.types.generated.ts (4 hunks)
  • package.json (1 hunks)
🔇 Additional comments (8)
apps/web/src/lib/sanity/queries/pages/home.ts (1)

33-33: LGTM! Field renamed correctly in the query.

The testimonial field has been properly renamed from showAlways to show in the homePageTestimonialsQuery.

apps/studio/schemas/documents/testimonial.ts (1)

43-46: LGTM! Schema field renamed with improved descriptions.

The testimonial schema has been updated correctly:

  • Field name changed from showAlways to show
  • German title and description updated to be more precise
  • Field type and other properties maintained correctly
apps/web/src/types/sanity.types.generated.ts (1)

783-783: LGTM! Type definitions updated consistently.

The auto-generated type definitions have been updated correctly to reflect the field rename from showAlways to show across all relevant types.

Also applies to: 1540-1540, 1559-1559

.github/workflows/sonar.yml (1)

Line range hint 18-23: LGTM! Added SonarCloud scanning for improved code quality.

The SonarCloud scan step has been properly configured:

  • Uses the official SonarSource GitHub action
  • Correctly sets up required tokens via environment variables
  • Will help maintain code quality through static analysis
.github/workflows/check.yml (2)

24-25: LGTM! Good addition of the NI package manager.

The addition of @antfu/ni provides unified package management commands, making the workflow more robust across different package managers.


28-28: Verify the ni commands work as expected.

The commands have been updated to use ni alternatives:

  • nci replaces pnpm install
  • nlx turbo replaces pnpm run

These changes look good but should be tested to ensure they work correctly with the project's setup.

Also applies to: 31-31

✅ Verification successful

The ni commands are properly configured and will work as expected

The workflow has the correct setup sequence with pnpm, Node.js, and @antfu/ni global installation before using the ni commands.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the project's package manager configuration
echo "Checking package manager configuration..."
cat package.json | jq '.packageManager'

# Check if turbo config exists
echo "Checking for turbo configuration..."
find . -name "turbo.json" -o -name ".turbo"

Length of output: 282


Script:

#!/bin/bash
# Check the complete workflow file
echo "Checking workflow setup..."
cat .github/workflows/check.yml

# Check for global ni installation or setup steps
echo -e "\nSearching for ni setup in workflows..."
rg "antfu|setup-node|corepack" .github/workflows/

Length of output: 1077

package.json (1)

43-43: Verify Node.js version compatibility.

The Node.js version has been updated to 22.13.1, which is a very recent version. While patch updates are generally safe, version 22.x is currently in development and not recommended for production use.

Consider using the latest LTS version instead. Run this script to check Node.js version status:

apps/studio/schema.json (1)

Line range hint 4486-4491: LGTM! Field renamed from 'showAlways' to 'show'.

The schema change looks good. The field maintains its boolean type and optional status.

Let's verify that all references to this field have been updated:

✅ Verification successful

Field rename from 'showAlways' to 'show' is correctly implemented across the codebase

The verification confirms:

  • Schema correctly defines the 'show' field with boolean type
  • Query in news-article.ts properly includes the new field name
  • Types are correctly generated in sanity.types.generated.ts
  • No remaining references to 'showAlways' exist in the codebase
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to 'showAlways'
echo "Checking for remaining references to 'showAlways'..."
rg -l "showAlways"

# Search for new field usage
echo "Checking usage of new 'show' field..."
rg -l "testimonial.*show[^a-zA-Z]"

Length of output: 312


Script:

#!/bin/bash
# Search for testimonial-related files
echo "Searching for testimonial-related files..."
fd -t f testimonial

# Check content of testimonial-related files
echo -e "\nChecking content of testimonial components and queries..."
rg -C 3 "testimonial.*show|show.*testimonial" --type ts --type tsx --type js --type jsx

Length of output: 595


Script:

#!/bin/bash
echo "Checking testimonial schema and component files..."
for file in apps/studio/schemas/documents/testimonial.ts \
           apps/studio/schemas/single-pages/home/testimonial.ts \
           apps/web/src/app/_home/testimonial-group.tsx \
           apps/web/src/app/_home/testimonials.tsx; do
  echo -e "\n=== Content of $file ===\n"
  cat "$file"
done

Length of output: 8539


Script:

#!/bin/bash
# Search for query files and their content
echo "Checking query files for testimonial queries..."
rg -g "*.{ts,tsx}" -C 3 "groq|gql" . | rg -C 3 "testimonial"

Length of output: 165


Script:

#!/bin/bash
echo "Searching for Sanity query files..."
# Look for files that might contain Sanity queries
fd -e ts -e tsx | grep -i "query\|sanity" | while read -r file; do
    echo -e "\n=== Content of $file ==="
    grep -A 5 -B 5 "testimonial" "$file" 2>/dev/null
done

Length of output: 7895

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kodiakhq kodiakhq bot merged commit a43758d into main Jan 26, 2025
11 checks passed
@kodiakhq kodiakhq bot deleted the 162-testimonial-rename-field branch January 26, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Belongs to the Next.js App studio Belongs to the Sanity Studio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testimonial - rename field "Zitat immer anzeigen"
1 participant