Fix:File Formatting and bug fix#1284
Conversation
- Updated feature issue template by removing unnecessary newline. - Modified AUR publish workflow to improve permissions and streamline version checking. - Enhanced build-and-release workflow by adjusting environment variable formatting. - Fixed duplicate issue detector workflow by standardizing Python version syntax. - Revised Code of Conduct for improved formatting and clarity. - Improved Manual Setup Guide for better readability and consistency in code blocks. - Cleaned up OpenAPI JSON file by consolidating tags for better organization. - Updated frontend documentation for memories and state management to enhance code clarity. - Added a new line in the index.md file for improved formatting. - Refined extra.css for better styling consistency and responsiveness. ran npx prettier .--write on root folder
|
|
WalkthroughThis PR reorganizes CodeRabbit review config (.coderabbit.yaml) with early_access and chat.auto_reply, updates GitHub Actions (AUR publish version handling and permissions plus minor workflow formatting), restructures setup/community docs, and applies formatting changes across frontend docs, OpenAPI JSON, and stylesheet presentation. ChangesRepository Configuration and Documentation Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
|
|
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/backend/backend_python/openapi.json (1)
1-3218:⚠️ Potential issue | 🟠 MajorUpdate OpenAPI 401 responses for hidden-album password checks (securitySchemes omission is consistent)
docs/backend/backend_python/openapi.jsoncorrectly omits top-levelsecurity/components.securitySchemes; backend doesn’t use FastAPI HTTP auth schemes—its 401s come from handler-level permission/password checks.- OpenAPI is still missing
401for password-protected hidden albums:PUT /albums/{album_id}andPOST /albums/{album_id}/images/get(backend raisesstatus.HTTP_401_UNAUTHORIZEDwhencurrent_password/passwordis missing or incorrect).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/backend/backend_python/openapi.json` around lines 1 - 3218, Add a 401 response for the hidden-album password checks on the two endpoints: update_album_albums__album_id__put and get_album_images_albums__album_id__images_get_post; specifically, update the OpenAPI paths for PUT /albums/{album_id} (operationId update_album_albums__album_id__put) and POST /albums/{album_id}/images/get (operationId get_album_images_albums__album_id__images_get_post) to include a "401" response entry that returns the same error schema used by other album/folder error responses (e.g. reference the existing app__schemas__folders__ErrorResponse or the appropriate project error schema) so the spec documents the backend's status.HTTP_401_UNAUTHORIZED behavior when current_password/password is missing or incorrect.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/aur-publish.yml:
- Around line 84-93: The "Publish to AUR" job uses the mutable action reference
KSXGitHub/github-actions-deploy-aur@v4.1.3; update that reference to the
action's immutable full 40-character commit SHA (replace `@v4.1.3` with
@<full-commit-sha>) so the workflow pins the exact release, and while editing
the same workflow also consider pinning actions/checkout@v4,
actions/upload-artifact@v4, and actions/download-artifact@v4 to their respective
full commit SHAs to avoid future breakage.
- Around line 46-48: Validate the VERSION from
steps.check_version.outputs.latest_version before using it: ensure VERSION
matches an allowlist/expected semver or regex (e.g.,
^v?\d+\.\d+\.\d+(-[A-Za-z0-9.-]+)?$) and fail the job early if not, then only
construct DEB_URL and run sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD after
validation; likewise validate SHA after computing it by checking it is a
64-character hex string (/[0-9a-fA-F]{64}/) and fail fast if it does not match
before running sed -i "s/sha256sums=.*/sha256sums=('$SHA')/" PKGBUILD so no
substitution occurs with malformed values.
In `@docs/backend/backend_python/openapi.json`:
- Line 1480: The operation's tags array contains a duplicate "Shutdown" entry;
locate the tags property that currently reads ["Shutdown", "Shutdown"] and
remove the redundant element so the array contains a single "Shutdown" string
(i.e., change to ["Shutdown"]); also scan the surrounding OpenAPI operation
object (the tags field) to ensure no other duplicate tag arrays remain.
In `@docs/frontend/memories.md`:
- Around line 281-283: The JSX example is invalid due to an extraneous semicolon
inside the expression block; update the snippet using the conditional rendering
expression with no trailing semicolon so it returns the element (e.g.,
{!showMediaView && <div onClick={handleCloseViewer>{/* Grid content */}</div>})
— locate the example referencing showMediaView and handleCloseViewer and remove
the semicolon and any superfluous braces so the JSX is valid when copied.
In `@docs/Manual_Setup_Guide.md`:
- Line 104: Update the sentence that currently reads "In test mode," to "In
development mode" within the docs section that describes running the backend
with "fastapi dev" (the sentence that starts "The server will start on
`http://localhost:52123` by default. In test mode,..."). Ensure the phrase "In
development mode" replaces "In test mode" so the documentation correctly
reflects the development (fastapi dev) run instructions and matches project
guidelines.
In `@docs/stylesheets/extra.css`:
- Line 14: Remove the stray blank line before the CSS declaration to satisfy
stylelint's declaration-empty-line-before rule: edit docs/stylesheets/extra.css
and ensure the padding-right: 0; declaration immediately follows the previous
token (e.g., previous declaration or the opening brace) within the same rule
block so there is no empty line before padding-right.
---
Outside diff comments:
In `@docs/backend/backend_python/openapi.json`:
- Around line 1-3218: Add a 401 response for the hidden-album password checks on
the two endpoints: update_album_albums__album_id__put and
get_album_images_albums__album_id__images_get_post; specifically, update the
OpenAPI paths for PUT /albums/{album_id} (operationId
update_album_albums__album_id__put) and POST /albums/{album_id}/images/get
(operationId get_album_images_albums__album_id__images_get_post) to include a
"401" response entry that returns the same error schema used by other
album/folder error responses (e.g. reference the existing
app__schemas__folders__ErrorResponse or the appropriate project error schema) so
the spec documents the backend's status.HTTP_401_UNAUTHORIZED behavior when
current_password/password is missing or incorrect.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 70cd6c4d-8e20-45f2-880b-c398a29ccff8
📒 Files selected for processing (14)
.coderabbit.yaml.github/.markdownlint-cli2.jsonc.github/ISSUE_TEMPLATE/feature.yml.github/workflows/aur-publish.yml.github/workflows/build-and-release.yml.github/workflows/duplicate_issue_detector.yamlCODE_OF_CONDUCT.mddocs/Manual_Setup_Guide.mddocs/backend/backend_python/openapi.jsondocs/frontend/memories.mddocs/frontend/screenshots.mddocs/frontend/state-management.mddocs/index.mddocs/stylesheets/extra.css
💤 Files with no reviewable changes (1)
- .github/ISSUE_TEMPLATE/feature.yml
|
|
1 similar comment
|
|
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/aur-publish.yml (1)
30-33:⚠️ Potential issue | 🟠 Major | ⚡ Quick winNormalize
tag_namebefore using it aspkgverand in the.debURL.
Line 46uses rawlatest_versionfor both release-tag path and filename. If GitHub returnstag_name=vX.Y.Z, this can producePictoPy_vX.Y.Z_amd64.debandpkgver=vX.Y.Z, which conflicts with the PKGBUILD source contract (.../download/v${pkgver}/PictoPy_${pkgver}_amd64.deb) and can break AUR updates.Suggested fix
- LATEST_VERSION=$(curl -fsSL https://api.github.com/repos/AOSSIE-Org/PictoPy/releases/latest \ - | grep -oP '(?<="tag_name": ")[^"]+') + TAG_NAME=$(curl -fsSL https://api.github.com/repos/AOSSIE-Org/PictoPy/releases/latest \ + | grep -oP '(?<="tag_name": ")[^"]+') + LATEST_VERSION="${TAG_NAME#v}" + if ! echo "$LATEST_VERSION" | grep -qP '^[0-9]+\.[0-9]+\.[0-9]+([.-][A-Za-z0-9]+)*$'; then + echo "ERROR: Invalid release version: $LATEST_VERSION" + exit 1 + fi ... - VERSION="${{ steps.check_version.outputs.latest_version }}" - DEB_URL="https://github.com/AOSSIE-Org/PictoPy/releases/download/${VERSION}/PictoPy_${VERSION}_amd64.deb" + VERSION="${{ steps.check_version.outputs.latest_version }}" + DEB_URL="https://github.com/AOSSIE-Org/PictoPy/releases/download/v${VERSION}/PictoPy_${VERSION}_amd64.deb"Also applies to: 46-47, 61-61
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/aur-publish.yml around lines 30 - 33, The fetched LATEST_VERSION may include a leading "v" (e.g., "v1.2.3") which must be normalized before using as pkgver or in .deb download paths; change the flow so after extracting LATEST_VERSION you create a normalized variable (e.g., STRIPPED_VERSION) by removing a leading "v" or any non-numeric prefix, use that normalized value for CURRENT_VERSION/pkgver and in the .deb filename and download URL (references: LATEST_VERSION, CURRENT_VERSION, the .deb filename construction and download URL usage).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In @.github/workflows/aur-publish.yml:
- Around line 30-33: The fetched LATEST_VERSION may include a leading "v" (e.g.,
"v1.2.3") which must be normalized before using as pkgver or in .deb download
paths; change the flow so after extracting LATEST_VERSION you create a
normalized variable (e.g., STRIPPED_VERSION) by removing a leading "v" or any
non-numeric prefix, use that normalized value for CURRENT_VERSION/pkgver and in
the .deb filename and download URL (references: LATEST_VERSION, CURRENT_VERSION,
the .deb filename construction and download URL usage).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c4765350-6b78-4007-be38-f6dbed114a8d
📒 Files selected for processing (2)
.github/workflows/aur-publish.ymldocs/frontend/memories.md
✅ Files skipped from review due to trivial changes (1)
- docs/frontend/memories.md
|
@rohan-pandeyy , PR is ready for review |
Summary
Repo-wide prettier formatting pass and bug fixes from the previous PR.#1268
Description
npx prettier . --writeacross the entire repo to enforce consistent code stylevprefix from the version-matching regex so it correctly matches version stringsvfrom the.debdownload URL to align with the corrected version formatPKGBUILDSummary by CodeRabbit
Documentation
Chores