Skip to content

Restore project's own pre/post npm scripts#4261

Open
Copilot wants to merge 4 commits intomasterfrom
copilot/restore-pre-post-scripts
Open

Restore project's own pre/post npm scripts#4261
Copilot wants to merge 4 commits intomasterfrom
copilot/restore-pre-post-scripts

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

ignore-scripts=true in .npmrc (added in #4045) inadvertently suppressed the project's own pre*/post* scripts (e.g., prefrontend, postlicense-report-backend) in addition to third-party lifecycle hooks.

Changes

  • Deleted .npmrc — all install commands that need to block third-party lifecycle scripts already pass --ignore-scripts explicitly:
    • package.json start: npm i --ignore-scripts
    • Dockerfile: npm ci --ignore-scripts
    • CI workflows: npm ci --ignore-scripts
  • Removed COPY .npmrc ./ from Dockerfile — file no longer exists
  • Added --ignore-scripts to npx in scripts/generate_openapi.py — restores the third-party lifecycle script protection previously provided by .npmrc

Devin review: https://app.devin.ai/review/sillsdev/TheCombine/pull/4261


This change is Reviewable

Summary by CodeRabbit

  • Chores
    • Updated Docker build configuration to modify npm script handling during dependency installation
    • Adjusted npm lifecycle script execution behavior across the build pipeline

This change is Reviewable

Copilot AI changed the title [WIP] Restore pre and post scripts in package.json Restore project's own pre/post npm scripts Apr 10, 2026
Copilot AI requested a review from imnasnainaec April 10, 2026 20:13
@imnasnainaec
Copy link
Copy Markdown
Collaborator

@copilot Should --ingore-scripts be added to the npx command in scripts/generate_openapi.py?

Agent-Logs-Url: https://github.com/sillsdev/TheCombine/sessions/ff17ac8b-e651-4a8d-a115-6d9fdb971342

Co-authored-by: imnasnainaec <6411521+imnasnainaec@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 10, 2026

@copilot Should --ingore-scripts be added to the npx command in scripts/generate_openapi.py?

Yes, added --ignore-scripts to that npx call in 88c0bc3. This is consistent with all the npx invocations in package.json which already use --ignore-scripts.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

⚠️ Commit Message Format Issues ⚠️
commit 88c0bc37b3:
3: B1 Line exceeds max length (100>80): "Agent-Logs-Url: https://github.com/sillsdev/TheCombine/sessions/ff17ac8b-e651-4a8d-a115-6d9fdb971342"

commit f0c65e75cb:
1: T1 Title exceeds max length (74>72): "Remove ignore-scripts=true from .npmrc to restore project pre/post scripts"
3: B1 Line exceeds max length (100>80): "Agent-Logs-Url: https://github.com/sillsdev/TheCombine/sessions/5728e502-781d-41dc-8c28-e5cd70bdd5bf"

@imnasnainaec

This comment was marked as resolved.

@coderabbitai

This comment was marked as outdated.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

The changes remove global npm lifecycle script disabling from .npmrc and the Docker build context, replacing it with selective --ignore-scripts flags applied directly in Docker and OpenAPI generation commands.

Changes

Cohort / File(s) Summary
npm Configuration
.npmrc, .dockerignore
Removed ignore-scripts=true configuration from .npmrc and deleted the !.npmrc negation rule from .dockerignore, eliminating global npm script disabling.
Build Process Updates
Dockerfile, scripts/generate_openapi.py
Removed .npmrc copy step from Docker build stage; added --ignore-scripts flag to npx invocation in OpenAPI generation script for targeted script disabling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 No more global scripts we say,
The .npmrc has slipped away,
Now flags appear where needed most,
Each command speaks its own fine post,
Selective silence, neat and clean! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective: restoring the project's own pre/post npm scripts by removing the blanket ignore-scripts setting.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch copilot/restore-pre-post-scripts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@imnasnainaec imnasnainaec marked this pull request as ready for review April 10, 2026 21:12
@imnasnainaec imnasnainaec added the 🟩Low Low-priority PR label Apr 10, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.94%. Comparing base (89f76ce) to head (88c0bc3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4261   +/-   ##
=======================================
  Coverage   75.94%   75.94%           
=======================================
  Files         303      303           
  Lines       11352    11352           
  Branches     1403     1403           
=======================================
  Hits         8621     8621           
  Misses       2330     2330           
  Partials      401      401           
Flag Coverage Δ
backend 87.23% <ø> (ø)
frontend 66.79% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Our own pre- and post- scripts are disabled

2 participants