Skip to content

Improvement/cldsrv 875 integrate shared prettier#6124

Open
benzekrimaha wants to merge 4 commits intodevelopment/9.3from
improvement/CLDSRV-875-Integrate-shared-prettier
Open

Improvement/cldsrv 875 integrate shared prettier#6124
benzekrimaha wants to merge 4 commits intodevelopment/9.3from
improvement/CLDSRV-875-Integrate-shared-prettier

Conversation

@benzekrimaha
Copy link
Copy Markdown
Contributor

@benzekrimaha benzekrimaha commented Mar 31, 2026

Issue: CLDSRV-875

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 31, 2026

Hello benzekrimaha,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

Comment thread scripts/format-changed.sh Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

  • Bug: scripts/format-changed.sh:33 — the grep regex double-escapes the backslash (\\. instead of \.), so the pattern matches a literal backslash before the dot. No filenames contain a backslash, so zero files will ever match and the Prettier check silently passes without checking anything.
    • Use a single backslash before the dot in the grep pattern

Review by Claude Code

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-875-Integrate-shared-prettier branch 2 times, most recently from e57392c to e85ae46 Compare March 31, 2026 16:25
Comment thread scripts/format-changed.sh Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

  • scripts/format-changed.sh:33 — double backslash in grep pattern makes the file-extension filter a no-op, so the Prettier check silently passes on every PR without actually checking any files.

    Review by Claude Code

Comment thread .github/workflows/tests.yaml Outdated
Comment thread scripts/format-changed.sh Outdated
@scality scality deleted a comment from bert-e Mar 31, 2026
@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

  • Bug: grep regex never matches any files (scripts/format-changed.sh:29) — Double backslash in single-quoted grep pattern means no file extensions will match, so the Prettier check is a no-op on every PR. Fix: use a single backslash before the dot.
    - CI: unnecessary full clone on push builds (.github/workflows/tests.yaml:87) — fetch-depth: 0 applies to all triggers but is only needed for the Prettier step on pull_request events. Consider making it conditional.

    Review by Claude Code

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 31, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

Comment thread scripts/format-changed.sh Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

  • scripts/format-changed.sh:29 — Double-escaped backslash in grep pattern (\\\.) causes file extension matching to fail silently. No files ever match, so the Prettier check is effectively a no-op. Use a single backslash (\.) to match a literal dot.

Review by Claude Code

Comment thread .github/workflows/tests.yaml Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

  • --depth=0 is not a valid documented git fetch option (.github/workflows/tests.yaml:98)
    • Remove the --depth=0 flag or use a valid positive integer

Review by Claude Code

Comment thread .github/workflows/tests.yaml Outdated
Comment thread .github/workflows/tests.yaml Outdated
Comment thread scripts/format-changed.sh Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

  • Shallow fetch depth may break three-dot diff (.github/workflows/tests.yaml:98): --depth=1 fetches only the base branch tip. The script uses BASE_SHA...HEAD (three-dot), which requires merge-base computation and may fail with insufficient history.
    • Increase fetch depth or switch to two-dot diff in the script
  • Script injection in workflow (.github/workflows/tests.yaml:98): ${{ github.event.pull_request.base.ref }} used directly in run: — pass via env var instead per GitHub Security Lab best practices.
    • Use an env: block to pass base.ref and reference $BASE_REF in the command
  • Silent skip on missing base ref (scripts/format-changed.sh:26): Exits 0 when base ref is unresolvable, silently skipping the prettier check.
    • Use ::warning:: annotation so the skip is visible in CI summary


Review by Claude Code

Comment thread .github/workflows/tests.yaml Outdated
Comment thread scripts/format-changed.sh Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

  • Adding pull_request trigger alongside existing push trigger causes all CI jobs to run twice for PRs (once per event). Only the Prettier step is gated on event type.
    • Restrict push to default branch only, or add a concurrency group to cancel duplicates.
  • format-changed.sh fetch fallback (line 20) cannot fetch by raw SHA from most remotes; if the base SHA is outside the shallow clone depth, the Prettier check silently skips.
    • Use BASE_REF for the fetch fallback instead of stripping origin/ from a SHA.

Review by Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented Mar 31, 2026

LGTM

Review by Claude Code

@scality scality deleted a comment from codecov Bot Mar 31, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.36%. Comparing base (bb5ca88) to head (8cea46e).
⚠️ Report is 18 commits behind head on development/9.3.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph
see 4 files with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.3    #6124      +/-   ##
===================================================
- Coverage            84.45%   84.36%   -0.09%     
===================================================
  Files                  206      206              
  Lines                13307    13307              
===================================================
- Hits                 11238    11227      -11     
- Misses                2069     2080      +11     
Flag Coverage Δ
file-ft-tests 67.90% <ø> (-0.06%) ⬇️
kmip-ft-tests 28.12% <ø> (-0.04%) ⬇️
mongo-v0-ft-tests 69.11% <ø> (-0.10%) ⬇️
mongo-v1-ft-tests 69.10% <ø> (-0.13%) ⬇️
multiple-backend 36.33% <ø> (ø)
sur-tests 35.59% <ø> (-0.04%) ⬇️
sur-tests-inflights 37.43% <ø> (-0.04%) ⬇️
unit 70.16% <ø> (ø)
utapi-v2-tests 34.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread package.json
@claude
Copy link
Copy Markdown

claude Bot commented Apr 1, 2026

  • package.json reformatted to 4-space indentation will conflict with yarn's native 2-space output when dependencies are added/removed, requiring developers to re-run prettier after every yarn add/remove
    - Exclude package.json from prettier via .prettierignore, or document this step in contributing guidelines

    Review by Claude Code


permissions:
contents: read
packages: write
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The concurrency group uses pull_request.head.sha, which changes with every new commit pushed to the PR. This means each push creates a different concurrency group, so previous runs won't be canceled — defeating the purpose of cancel-in-progress: true.

Use the PR number (or head_ref) instead so that successive pushes to the same PR cancel prior runs:

```suggestion
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}

@claude
Copy link
Copy Markdown

claude Bot commented Apr 1, 2026

  • Concurrency group uses pull_request.head.sha which is unique per commit, so cancel-in-progress won't actually cancel previous runs for the same PR. Use pull_request.number instead.

    Review by Claude Code

@delthas delthas removed their request for review April 10, 2026 08:18
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-875-Integrate-shared-prettier branch from 16e46ef to d8df099 Compare April 15, 2026 17:07
Comment thread .github/workflows/lint.yaml
Comment thread scripts/prettier-diff.sh Outdated
Comment thread scripts/prettier-diff.sh Outdated
Comment thread scripts/prettier-diff.sh Outdated
Comment thread scripts/prettier-diff.sh Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread .github/workflows/tests.yaml Outdated
lint:
uses: ./.github/workflows/lint.yaml
with:
git-diff-args: ${{ github.event_name == 'push' && format('{0}..{1}', github.event.before, github.sha) || 'HEAD~1..HEAD' }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not correct : should run on the diff from "upstream" to now.

for exemple: if we push 1 commit, then another 1 → script must run on the whole diff (2 commits), not just the last one

Comment thread .github/workflows/lint.yaml Outdated
else
yarn run --silent prettier:diff --check
fi
MERGE_BASE=$(git merge-base HEAD origin/HEAD)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge-base should work, but not sure about origin/HEAD : may be ok if the latest development branch is indeed the "default" one, but could fail otherwise.

maybe a slightly safer way would be to list all development branches, something like

MERGE_BASE=$(git merge-base HEAD $(git branch --list 'development/*'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(to be tested, not sure we have all branches locally or if we need to add the origin/ prefix)

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-875-Integrate-shared-prettier branch from 1a01b41 to 666b8cd Compare April 29, 2026 12:34
pull_request:
branches-ignore:
- 'q/*/**'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lint.yaml uses actions/checkout@v6 and actions/setup-node@v6 while tests.yaml still uses @v4 for both. This inconsistency could cause subtle differences in checkout behavior (e.g. git config, fetch behavior) between the two workflows. Consider aligning both files on the same major version.

— Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented Apr 29, 2026

  • Inconsistent GitHub Actions versions: lint.yaml uses actions/checkout@v6 and actions/setup-node@v6 while tests.yaml uses @v4 for both. Align on the same major version to avoid subtle behavioral differences between workflows.

    Review by Claude Code

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-875-Integrate-shared-prettier branch from 666b8cd to eefa22b Compare April 29, 2026 12:42
Comment thread scripts/prettier-diff.sh Outdated
done

if [[ "$HAS_MODE" = false ]]; then
PRETTIER_ARGS=("--write" "${PRETTIER_ARGS[@]}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The default mode when no flag is given is --write, which silently modifies files in-place. A safer default for a CI-oriented script would be --check, so that running the script without explicit flags does not mutate the working tree unexpectedly.

— Claude Code

Comment thread .github/workflows/tests.yaml Outdated

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cancel-in-progress: true on the entire workflow means a new push cancels all in-flight jobs. If any of these jobs (lint, unit-tests, etc.) are required status checks in branch protection, a cancelled run counts as a failure, blocking merge until a clean run completes. Consider whether this is the intended behavior, especially with unit-tests now gated on lint via needs: lint — a cancellation during lint will cascade and cancel unit-tests too.

— Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented Apr 29, 2026

  • scripts/prettier-diff.sh defaults to --write when no mode flag is given, which silently mutates files. Consider defaulting to --check for safety.
    • Change the fallback on line 37 from --write to --check.
  • cancel-in-progress: true on the workflow-level concurrency group will cancel all in-flight jobs on new pushes, which may block merges if any job is a required status check. The new needs: lint dependency on unit-tests amplifies this — a cancelled lint cascades to unit-tests.
    • Consider scoping concurrency per-job, or removing cancel-in-progress if these are required checks.

Review by Claude Code

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-875-Integrate-shared-prettier branch from eefa22b to e3119f9 Compare April 29, 2026 12:45
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-875-Integrate-shared-prettier branch from e3119f9 to cda30ba Compare April 29, 2026 12:47
run: yarn install --frozen-lockfile --network-concurrency 1
- uses: actions/setup-python@v5
with:
python-version: '3.9'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The unit-tests job now has needs: lint, which serializes it after the lint job. Previously unit tests and lint ran in parallel. This means a slow or flaky lint step blocks all unit tests, and contributors won't get test feedback until lint passes. This is a deliberate CI change worth calling out since the PR is framed as a prettier integration.

— Claude Code

Comment thread .github/workflows/tests.yaml Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Apr 29, 2026

  • The PR bundles two behavioral CI changes alongside the prettier integration:
    - unit-tests now needs: lint, serializing unit tests after lint instead of running them in parallel
    - A new concurrency block cancels in-progress workflow runs on same-branch pushes, which could interrupt long-running test jobs
    - Consider documenting these CI changes in the PR description since they are not formatting-related

    Review by Claude Code

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-875-Integrate-shared-prettier branch from cda30ba to 8cea46e Compare April 29, 2026 12:49
@claude
Copy link
Copy Markdown

claude Bot commented Apr 29, 2026

LGTM

The PR cleanly integrates the shared Prettier config. The new lint.yaml workflow, prettier-diff.sh script, and config files are well-structured. The script correctly handles empty file lists, uses set -euo pipefail, and filters deleted files via --diff-filter=ACMRT. Dependency pinning is correct (@scality/eslint-config-scality pinned to tag 8.3.1, prettier as a caret-range devDependency). The build-args: to build-args: | YAML change in the Docker build step is semantically equivalent and safe.

Review by Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented Apr 29, 2026

LGTM

Review by Claude Code

@DarkIsDude DarkIsDude self-requested a review April 30, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants