Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include git hash in UI #574

Merged
merged 7 commits into from
Nov 19, 2024
Merged

Conversation

kleysc
Copy link
Contributor

@kleysc kleysc commented Nov 7, 2024

Issue #511

This PR adds the Git commit hash to the footer for easy version identification

  1. Goal: Display the current version in the UI to improve traceability of deployments.

  2. Implementation:

  • Footer.tsx: Now displays the GIT_COMMIT_HASH to show the commit hash in the footer.
  • package.json: A prebuild script has been added to automatically generate Version.tsx with the current commit hash before each build.
Screenshot 2024-11-07 at 2 34 03 AM

Summary by CodeRabbit

  • New Features

    • Enhanced footer layout and functionality with improved organization and presentation of links.
    • Integrated version information display directly in the footer.
    • Introduced a new version constant and retrieval function for displaying version details.
  • Bug Fixes

    • Adjusted spacing and layout properties for better visual alignment in the footer.

@kleysc kleysc requested review from a team as code owners November 7, 2024 06:00
Copy link

vercel bot commented Nov 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 1:45am

Copy link
Contributor

coderabbitai bot commented Nov 7, 2024

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The changes involve updates to the Footer component in Footer.tsx, enhancing its layout and functionality by integrating version information. The Version.tsx file introduces a new constant and a function to retrieve version details. The Footer now uses Flex components for layout, displaying the version as a link, and the overall presentation has been simplified.

Changes

File Change Summary
apps/router/src/components/Footer.tsx Modified layout using nested Flex components, added version display using getVersionInfo(), and adjusted spacing properties.
apps/router/src/constants/Version.tsx Introduced constant RELEASE_TAG and function getVersionInfo() to provide version information.

Possibly related PRs

  • Include git hash in UI #574: The changes in this PR also modify the Footer component in Footer.tsx, restructuring its layout and functionality, and include a new constant GIT_COMMIT_HASH from @fedimint/router/src/constants/Version, which is closely related to the changes made in the main PR.

Warning

Rate limit exceeded

@Kodylow has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7fac5b2 and c9f9ac8.

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/router/src/components/Footer.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /apps/router/.eslintrc.js
Error: Cannot find module '@fedimint/eslint-config'
Require stack:

  • /apps/router/.eslintrc.js
  • /node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/eslint/lib/eslint/index.js
  • /node_modules/eslint/lib/cli.js
  • /node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/apps/router/.eslintrc.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 3

🧹 Outside diff range and nitpick comments (3)
apps/router/src/components/Footer.tsx (2)

Line range hint 35-39: Fix tab order in mobile view

Using column-reverse on mobile disrupts the natural tab order, which can cause accessibility issues. Consider using column instead and adjusting visual order through other means.

     <Flex
       bgColor={theme.colors.gray[100]}
       p='28px'
       w='100%'
-      direction={{ base: 'column-reverse', sm: 'row' }}
+      direction={{ base: 'column', sm: 'row' }}
       align='center'
       justify='center'
     >

Line range hint 13-29: Add accessibility attributes to external links

External links opening in new tabs should warn users and include proper aria labels for screen readers.

       <Link
         _hover={{ textDecoration: 'underline' }}
         fontSize={{ base: 'xs', sm: 'sm', md: 'sm', lg: 'sm' }}
         fontWeight='500'
         color={theme.colors.gray[800]}
         transition={`text-decoration 1s ease-in-out`}
         href={href}
         target='_blank'
         rel='noreferrer'
+        aria-label={`${title} (opens in new tab)`}
         w='fit-content'
       >
-        {title}
+        {title} <span className="sr-only">(opens in new tab)</span>
       </Link>
flake.nix (1)

Line range hint 73-74: Synchronize package version with fedimint input

The hardcoded version "0.4.3" could become out of sync with the fedimint input version (currently also 0.4.3). Consider deriving it dynamically.

-          version = "0.4.3";
+          version = fedimint.version;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1ee9f74 and be7ea92.

📒 Files selected for processing (4)
  • apps/router/src/components/Footer.tsx (2 hunks)
  • apps/router/src/home/version.tsx (1 hunks)
  • flake.nix (1 hunks)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/router/src/home/version.tsx

package.json Outdated Show resolved Hide resolved
apps/router/src/components/Footer.tsx Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@kleysc kleysc changed the title Include git hash in UI issue #511 Include git hash in UI Nov 7, 2024
flake.nix Outdated Show resolved Hide resolved
@Kodylow
Copy link
Member

Kodylow commented Nov 15, 2024

Can you rebase this and have it print the release version when the git hash matches a formal release version?

@Kodylow
Copy link
Member

Kodylow commented Nov 19, 2024

rebased and modified to use tagged version links that'll work on cutting release, this isn't really needed in dev

@Kodylow Kodylow merged commit cf02442 into fedimint:master Nov 19, 2024
3 checks passed
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.

3 participants