WIP: feat: render the version and rev of the app in the web interface #372

Draft
erictapen wants to merge 2 commits from erictapen/display-version into main
erictapen commented 2024-11-19 10:34:38 +00:00 (Migrated from github.com)

Little side step, as I already finished this yesterday. I built this in a way that can't be tested well, but it should display the version on staging and production.

Closes https://github.com/Nix-Security-WG/nix-security-tracker/issues/358
tmp 8ctfjkuTnt

Little side step, as I already finished this yesterday. I built this in a way that can't be tested well, but it should display the version on staging and production. Closes https://github.com/Nix-Security-WG/nix-security-tracker/issues/358 ![tmp 8ctfjkuTnt](https://github.com/user-attachments/assets/ccd2ae1c-5937-4484-aabf-d27e023a3ada)
erictapen commented 2024-11-19 11:06:16 +00:00 (Migrated from github.com)

To clarify: I didn't test this, as I didn't manage to run the result of nix-build -A package locally.

To clarify: I didn't test this, as I didn't manage to run the result of `nix-build -A package` locally.
fricklerhandwerk (Migrated from github.com) approved these changes 2024-11-19 11:24:46 +00:00
fricklerhandwerk (Migrated from github.com) reviewed 2024-11-19 11:29:01 +00:00
fricklerhandwerk (Migrated from github.com) commented 2024-11-19 11:29:00 +00:00
 error:
       … while evaluating the attribute 'drvPath'

         at /nix/store/qn402m0jm11jp8rsimwfm3dfsfkv0i4b-source/lib/customisation.nix:365:7:

          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: '/home/runner/work/nix-security-tracker/nix-security-tracker' is a shallow Git repository, but shallow repositories are only allowed when `shallow = true;` is 

Maybe this helps?

      APP_REVISION = "${(builtins.fetchGit { url = ../.; shallow = true; }).rev}"
```log error: … while evaluating the attribute 'drvPath' at /nix/store/qn402m0jm11jp8rsimwfm3dfsfkv0i4b-source/lib/customisation.nix:365:7: 364| in commonAttrs // { 365| drvPath = assert condition; drv.drvPath; | ^ 366| outPath = assert condition; drv.outPath; … while calling the 'derivationStrict' builtin at /builtin/derivation.nix:9:12: (source not available) (stack trace truncated; use '--show-trace' to show the full trace) error: '/home/runner/work/nix-security-tracker/nix-security-tracker' is a shallow Git repository, but shallow repositories are only allowed when `shallow = true;` is ``` Maybe this helps? ```suggestion APP_REVISION = "${(builtins.fetchGit { url = ../.; shallow = true; }).rev}" ```
fricklerhandwerk commented 2024-11-19 22:43:32 +00:00 (Migrated from github.com)

image

The screenshot is from running it locally via fetchGit as described in the README.

Works in principle now but needs a lot of cleanup. Marked as draft until that's done. @erictapen I think you should spend your precious time on UX tasks. I'll see when I can squeeze in finishing this one up.

![image](https://github.com/user-attachments/assets/3fe34156-b74e-4f13-8112-29257ddaeabe) The screenshot is from running it locally via `fetchGit` as described in the README. Works in principle now but needs a lot of cleanup. Marked as draft until that's done. @erictapen I think you should spend your precious time on UX tasks. I'll see when I can squeeze in finishing this one up.
RaitoBezarius (Migrated from github.com) approved these changes 2024-11-20 11:53:29 +00:00
RaitoBezarius (Migrated from github.com) left a comment

Sounds good to me, we will need to handle the production version of the deployment and this cannot use builtins.fetchGit for that.

Sounds good to me, we will need to handle the production version of the deployment and this cannot use `builtins.fetchGit` for that.
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin erictapen/display-version:erictapen/display-version
git switch erictapen/display-version

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff erictapen/display-version
git switch erictapen/display-version
git rebase main
git switch main
git merge --ff-only erictapen/display-version
git switch erictapen/display-version
git rebase main
git switch main
git merge --no-ff erictapen/display-version
git switch main
git merge --squash erictapen/display-version
git switch main
git merge --ff-only erictapen/display-version
git switch main
git merge erictapen/display-version
git push origin main
Sign in to join this conversation.
No description provided.