Skip to content

fix(frontend): make dev footer version link to commit#3913

Closed
preeeetham wants to merge 1 commit intoOWASP:mainfrom
preeeetham:fix/3892-footer-version-link
Closed

fix(frontend): make dev footer version link to commit#3913
preeeetham wants to merge 1 commit intoOWASP:mainfrom
preeeetham:fix/3892-footer-version-link

Conversation

@preeeetham
Copy link
Contributor

@preeeetham preeeetham commented Feb 11, 2026

Proposed change

Resolves #3892

Makes the release version at the bottom of https://nest.owasp.dev/ a clickable link to the corresponding Git commit, while keeping the existing behavior on https://nest.owasp.org/.

Changes:

  • frontend/src/components/Footer.tsx: Version is now always a clickable link. In production → links to release tag; in non-production → links to commit (parses short SHA from RELEASE_VERSION when it contains a dash). Falls back to release tag URL when RELEASE_VERSION has no dash.
  • frontend/__tests__/unit/components/Footer.test.tsx: Added tests for non-production commit link and no-dash fallback.

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Caution

Review failed

The pull request is closed.

Summary by CodeRabbit

  • Tests

    • Added test suite for version link behavior, validating commit and release tag link rendering across staging and development environments.
  • Refactor

    • Simplified footer version link logic with conditional URL routing based on environment and version format.

Walkthrough

Replaces branching rendering in Footer with a single Link whose href conditionally targets a GitHub release or commit based on ENVIRONMENT and RELEASE_VERSION; adds unit tests (two equivalent suites present) that mock env to verify commit vs. release link rendering in non-production scenarios.

Changes

Cohort / File(s) Summary
Footer Component
frontend/src/components/Footer.tsx
Replaced separate conditional render paths with a single Link element whose href is computed: if non-production and RELEASE_VERSION contains a dash use the commit URL (suffix after last dash), otherwise use the release tag URL; visible text remains v{RELEASE_VERSION}.
Footer Tests
frontend/__tests__/unit/components/Footer.test.tsx
Added "Version Link Behavior" test suite that mocks env.client values to assert commit-link vs. release-tag link rendering in non-production; note: equivalent test suite block appears duplicated in the diff.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • kasya
🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: making the dev footer version link to the commit instead of being unclickable.
Linked Issues check ✅ Passed The PR successfully resolves issue #3892 by making the version link to commits in non-production environments and release tags in production, with appropriate test coverage.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue: Footer component logic and corresponding tests for version link behavior across environments.
Description check ✅ Passed The pull request description clearly relates to the changeset. It specifies the issue being resolved (#3892), describes the changes to Footer.tsx and its tests, and explains the new behavior for different environments.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

- Footer version is now always a clickable link
- Production: links to release tag (unchanged)
- Non-production with dash in RELEASE_VERSION: links to commit (e.g. 24.2.10-12c25c5 → /commit/12c25c5)
- Non-production without dash: falls back to release tag URL
- Added unit tests for Version Link Behavior

Co-authored-by: Cursor <cursoragent@cursor.com>
@preeeetham preeeetham force-pushed the fix/3892-footer-version-link branch from 5b10be6 to c5f1ce9 Compare February 11, 2026 19:33
@sonarqubecloud
Copy link

@preeeetham
Copy link
Contributor Author

Closing to create a fresh PR with a clean commit (no Co-authored-by, single focused change)

@preeeetham preeeetham closed this Feb 11, 2026
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.

Release version at bottom of https://nest.owasp.dev/ should link to relevant GitHub commit

1 participant