Skip to content

Feature/netlify config#589

Open
AnishCoder2006 wants to merge 3 commits into
GitMetricsLab:mainfrom
AnishCoder2006:feature/netlify-config
Open

Feature/netlify config#589
AnishCoder2006 wants to merge 3 commits into
GitMetricsLab:mainfrom
AnishCoder2006:feature/netlify-config

Conversation

@AnishCoder2006
Copy link
Copy Markdown

@AnishCoder2006 AnishCoder2006 commented May 28, 2026

PR Title
Add Netlify deploy config and fix feature/debounce remote sync

Summary
Closes: #511
Introduced Netlify configuration files to ensure successful deploy previews and synchronized the local feature/debounce branch with the remote fork. This prevents deploy failures and keeps branch history consistent.

Changes (key files)
Deployment:

netlify.toml: Explicitly configure Netlify build and publish settings.

public/_headers: Added security headers required by Netlify deploy checks.

public/_redirects: Cleaned SPA routing rules to ensure React Router works correctly on Netlify.

Git workflow:

Rebases local feature/debounce onto fork/feature/debounce.

Pushed updated branch to fork for PR creation.

Why
Prevents Netlify deploy preview failures due to missing or ambiguous redirect/header configuration.

Ensures SPA routing works correctly in production.

Keeps the feature/debounce branch synchronized with the fork remote before opening the PR.

How to test (local)
Run npm run build → project compiles successfully.

Deploy preview on Netlify → should pass without redirect/header errors.

Navigate through SPA routes (/activity, /bookmarks, etc.) → routing works correctly.

Confirm security headers are applied in browser dev tools (Network → Response Headers).

Acceptance criteria mapped
Netlify deploy previews succeed without errors.

SPA routing works correctly on Netlify.

Security headers are present in deploy responses.

Local feature/debounce branch matches remote fork branch.

Notes
Netlify config files (netlify.toml, _headers, _redirects) are lightweight and non‑breaking.

Branch sync ensures clean PR history and avoids “refspec does not match” errors.

No migration required; deploy config applies only to Netlify environment.

Summary by CodeRabbit

  • Chores
    • Updated build and deployment configuration
    • Enhanced security response headers
    • Optimized redirect rules for single-page application routing

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for github-spy failed.

Name Link
🔨 Latest commit fff1466
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a17bb76562b9b000824d029

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

This PR updates deployment configuration for the project: it pins a new github_tracker submodule commit, configures Netlify build settings and publishes to the dist directory with Node 18, establishes SPA routing by redirecting all routes to /index.html, and adds HTTP security headers including clickjacking protection, strict transport security, and referrer policies.

Changes

Deployment and Hosting Configuration

Layer / File(s) Summary
Submodule dependency update
github_tracker
The github_tracker submodule pointer is advanced to a new commit.
Netlify build configuration and SPA routing
netlify.toml, public/_redirects
Netlify build command installs dependencies and builds to dist, Node version is pinned to 18, and a catch-all route redirects all requests to /index.html with 200 status to enable SPA routing. Redirect formatting is normalized.
HTTP security headers configuration
netlify.toml, public/_headers
HTTP security headers are configured for all routes (/*) including X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, and Strict-Transport-Security with HSTS preload enabled.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A rabbit hops through configs, neat and clean,
Security headers—the finest I've seen!
With Netlify routing and HSTS in place,
The site now deploys with honor and grace! 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses Netlify configuration (issue #511 context) but does not implement the primary requirement: debouncing for GitHub API search inputs to prevent redundant requests.
Out of Scope Changes check ⚠️ Warning The PR includes changes to github_tracker subproject commit reference, which appears unrelated to the stated objectives of adding Netlify config and debouncing for API search inputs.
Title check ❓ Inconclusive The title 'Feature/netlify config' is vague and generic, not clearly describing the primary changes or their purpose. Use a more descriptive title that explains the main objective, e.g., 'Add Netlify deployment config with security headers and SPA routing rules' or 'Configure Netlify build, headers, and redirects for production deployment'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is comprehensive, covering all template sections including related issues, detailed changes, testing approach, and acceptance criteria.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
github_tracker (1)

1-223: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Submodule update is committed as text content instead of a gitlink pointer.

This file contains embedded commit metadata and a full patch body, which indicates the submodule update was recorded incorrectly. The parent repo should only store the submodule commit pointer (gitlink), not the submodule diff text. Please reset this to a real submodule reference update and remove the pasted patch content from github_tracker.

🤖 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_tracker` around lines 1 - 223, The file github_tracker contains a
pasted submodule diff/commit metadata instead of a gitlink; remove the embedded
patch text and replace it with a proper submodule pointer update. To fix: delete
the pasted patch content from the github_tracker file, add the submodule
correctly (or run git submodule update --init --recursive to fetch the
submodule) and update the parent repo to record the submodule commit SHA as a
gitlink (so the index stores mode 160000 with the submodule commit), then commit
that change; ensure the resulting commit only updates the submodule pointer and
does not include the patch body.
🤖 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 `@netlify.toml`:
- Line 2: The Netlify build command uses a non-deterministic install ("npm
install && npm run build"); generate and commit a package-lock.json to the repo,
then update the command in netlify.toml to use "npm ci && npm run build" so
installs are reproducible; specifically, replace the existing command string
value in netlify.toml with the npm ci variant after committing
package-lock.json.
- Line 4: The Netlify build env pins NODE_VERSION to an EOL release; update the
environment = { NODE_VERSION = "18" } entry to use the current Active LTS by
setting NODE_VERSION to "24" (or "22" only if explicit compatibility requires a
Maintenance LTS fallback), and ensure any CI/build docs that reference
NODE_VERSION are aligned with the change so builds use Node 24 by default.

---

Outside diff comments:
In `@github_tracker`:
- Around line 1-223: The file github_tracker contains a pasted submodule
diff/commit metadata instead of a gitlink; remove the embedded patch text and
replace it with a proper submodule pointer update. To fix: delete the pasted
patch content from the github_tracker file, add the submodule correctly (or run
git submodule update --init --recursive to fetch the submodule) and update the
parent repo to record the submodule commit SHA as a gitlink (so the index stores
mode 160000 with the submodule commit), then commit that change; ensure the
resulting commit only updates the submodule pointer and does not include the
patch body.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 929c8383-49c1-40c7-ac9c-88b344e8f2aa

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae0ef6 and fff1466.

📒 Files selected for processing (4)
  • github_tracker
  • netlify.toml
  • public/_headers
  • public/_redirects

Comment thread netlify.toml
@@ -0,0 +1,17 @@
[build]
command = "npm install && npm run build"
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify lockfile exists before switching install strategy
fd -HI '^package-lock\.json$' .

Repository: GitMetricsLab/github_tracker

Length of output: 54


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== netlify.toml =="
if [ -f netlify.toml ]; then
  nl -ba netlify.toml | sed -n '1,20p'
else
  echo "netlify.toml not found at repo root"
fi

echo
echo "== package-lock.json matches =="
fd -HI '^package-lock\.json$' .

Repository: GitMetricsLab/github_tracker

Length of output: 152


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== netlify.toml location(s) =="
fd -HI 'netlify\.toml$' .

echo
echo "== netlify.toml content (if present) =="
NETLIFY_FILES=$(fd -HI 'netlify\.toml$' . || true)
if [ -z "$NETLIFY_FILES" ]; then
  echo "No netlify.toml found."
else
  # Print with line numbers using awk (avoid nl)
  echo "$NETLIFY_FILES" | head -n 5 | while IFS= read -r f; do
    echo "--- $f ---"
    awk '{printf "%d:%s\n", NR, $0}' "$f" | sed -n '1,60p'
  done
fi

echo
echo "== package-lock.json matches =="
fd -HI '^package-lock\.json$' .

Repository: GitMetricsLab/github_tracker

Length of output: 680


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== lockfiles (package-lock.json) =="
fd -HI 'package-lock\.json$' .

echo
echo "== other lockfiles =="
fd -HI 'package-lock\.(json|yaml|yml)$' . || true
fd -HI 'yarn\.lock$' .
fd -HI 'pnpm-lock\.yaml$' .

Repository: GitMetricsLab/github_tracker

Length of output: 131


Make Netlify dependency installs deterministic (commit package-lock.json, then use npm ci).

netlify.toml uses npm install && npm run build, but there is no package-lock.json in the repo—so switching to npm ci would fail. Add/commit package-lock.json, then change the build command to npm ci && npm run build for reproducible installs.

🤖 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 `@netlify.toml` at line 2, The Netlify build command uses a non-deterministic
install ("npm install && npm run build"); generate and commit a
package-lock.json to the repo, then update the command in netlify.toml to use
"npm ci && npm run build" so installs are reproducible; specifically, replace
the existing command string value in netlify.toml with the npm ci variant after
committing package-lock.json.

Comment thread netlify.toml
[build]
command = "npm install && npm run build"
publish = "dist"
environment = { NODE_VERSION = "18" }
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

As of May 2026, what is the Node.js release schedule/status for Node 18, Node 20, and Node 22, and which versions are in active support or maintenance?

💡 Result:

As of May 28, 2026, the status of the requested Node.js versions is as follows: Node.js 18: This version has reached its End-of-Life (EOL) [1][2]. It transitioned to maintenance mode on October 18, 2023, and officially reached its EOL date on April 30, 2025 [1][3]. Node.js 20: This version has reached its End-of-Life (EOL) [1][4]. It reached its maintenance start date on October 22, 2024, and officially reached its EOL date on April 30, 2026 [1][5][3]. Node.js 22: This version is currently in Maintenance LTS status [1][6]. It transitioned from Active LTS to Maintenance LTS on October 21, 2025, and is scheduled to reach its EOL on April 30, 2027 [1][3][6]. In summary, none of these three versions are currently in "Active" support [1][2]. Node.js 22 is in the Maintenance phase of its lifecycle, while Node.js 18 and Node.js 20 are no longer supported [1][2][4]. For production environments, the project currently recommends using Active LTS releases, such as Node.js 24 [1][7][6].

Citations:


🌐 Web query:

As of May 2026, which Node.js major versions are in Active LTS (recommended for production) and what is the current Active LTS version number?

💡 Result:

As of 2026-05-28, the Node.js major versions in Active LTS (recommended for production) are: 1) Node.js 24.x (Active LTS) 2) Node.js 22.x is not Active LTS by May 2026; it is in Maintenance LTS (Active LTS is only 22.x? no—official schedule lists 22.x as Maintenance LTS). Active LTS major versions list (from the Node.js Release schedule): 24.x is marked “Active LTS”; 22.x is marked “Maintenance LTS” (not Active LTS) [1]. Therefore, as of May 2026, the only Active LTS major line is Node.js 24.x. Current Active LTS version number (exact release) as of May 2026: Node.js 24.16.0 (Krypton) [2].

Citations:


🌐 Web query:

Netlify Node runtime support / NODE_VERSION environment variable: which Node.js versions are supported for builds/deploys as of 2026?

💡 Result:

As of 2026-05-28, Netlify build-time Node.js versioning works like this: 1) Build-time (NODE_VERSION /.nvmrc /.node-version) - You can set the Node.js version used for builds via the reserved environment variable NODE_VERSION (or a.node-version/.nvmrc file). Netlify fetches the version using nvm and caches it for faster subsequent builds. [1][2] - However, Netlify does not publish a fixed “supported Node versions” list in the docs; instead it says you can select the major Node.js versions that Netlify currently supports in the UI, while NODE_VERSION may be set to “any released version of Node.js” (or any nvm-valid string). The practical implication is: Node versions must be installable by nvm in Netlify’s build environment and match what Netlify’s currently-supported build images allow. [1][2] What Netlify explicitly guarantees in docs for 2026-05-28: - NODE_VERSION supports both exact versions (e.g., “22.5.0”) and major versions (e.g., “22” meaning latest 22.x). [1] - Build Node.js defaults come from the selected Netlify build image; changing NODE_VERSION (or a.nvmrc/.node-version) overrides the UI selection. [1] 2) Deploy/runtime for Netlify Functions (AWS_LAMBDA_JS_RUNTIME) - For Node.js functions deployed on/after 2023-05-15, the default functions runtime is based on the Node.js version used for the build, but only if that build version is a “valid AWS Lambda runtime for Node.js” and is not set to be deprecated in the next two months; otherwise Netlify falls back to Node.js 22. [3] - You can override the functions runtime explicitly by setting the Netlify Functions env var AWS_LAMBDA_JS_RUNTIME (example: “nodejs20.x”), and you must redeploy. [3] - Therefore, for function runtime support as of 2026-05-28, the effective supported set is constrained to AWS Lambda’s Node.js runtimes that are currently valid and not imminently deprecated; AWS’s public Lambda runtime list includes nodejs22.x, nodejs24.x, nodejs20.x, nodejs18.x, etc. [3][4] Concrete answer to “which Node.js versions are supported … as of 2026?” - Build-time via NODE_VERSION: Netlify’s docs state you may use any released Node.js version that nvm understands (and is available in the build environment), and you can also use major version selectors like 22. [1] - Runtime for Netlify Functions (AWS_LAMBDA_JS_RUNTIME and the build-derived default): supported Node.js versions are those corresponding to AWS Lambda’s current Node.js runtimes (e.g., nodejs22.x, nodejs24.x, nodejs20.x, nodejs18.x), with Netlify falling back to Node.js 22 when the build version doesn’t meet the “valid + not deprecated in next two months” requirement. [3][4] If you want, tell me whether you mean (A) build-only (NODE_VERSION) or (B) serverless function runtime (AWS_LAMBDA_JS_RUNTIME / deployed Functions), and I’ll provide the most precise version list in that context using the AWS Lambda runtime identifiers.

Citations:


Bump Netlify build-time Node from EOL (18) to current LTS (24).

netlify.toml pins NODE_VERSION to 18, which is End-of-Life, and “20 or newer” is also outdated for 2026 since Node 20 reached EOL on 2026-04-30. Use Node 24 (Active LTS) as the default; allow Node 22 only if compatibility requires it (Maintenance LTS).

🤖 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 `@netlify.toml` at line 4, The Netlify build env pins NODE_VERSION to an EOL
release; update the environment = { NODE_VERSION = "18" } entry to use the
current Active LTS by setting NODE_VERSION to "24" (or "22" only if explicit
compatibility requires a Maintenance LTS fallback), and ensure any CI/build docs
that reference NODE_VERSION are aligned with the change so builds use Node 24 by
default.

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.

Performance: Add debouncing to GitHub API search inputs to prevent redundant requests

1 participant