[PR #3240] [CLOSED] Version string verbosity #3248

Closed
opened 2026-03-03 09:42:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3240
Author: @strump
Created: 2/11/2023
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • 7d7da92 Last tag is now optional. Timestamp is added to version string.

📊 Changes

1 file changed (+19 additions, -4 deletions)

View changed files

📝 build.rs (+19 -4)

📄 Description

Build script doesn't produce version string if no git history is available.

Steps to reproduce:

  1. Clone repo with no history (Mogenius.com does this): git clone --depth 1 https://github.com/dani-garcia/vaultwarden.git
  2. Build docker image: docker build --build-arg DB=sqlite -f docker/amd64/Dockerfile -t vaultwarden:local .
  3. Run it: docker run -it --rm vaultwarden:local

Actual result: no version information in output

/--------------------------------------------------------------------\
|                        Starting Vaultwarden                        |
|--------------------------------------------------------------------|
| This is an *unofficial* Bitwarden implementation, DO NOT use the   |
| official channels to report bugs/features, regardless of client.   |
| Send usage/configuration questions or feature requests to:         |
|   https://vaultwarden.discourse.group/                             |
| Report suspected bugs/issues in the software itself at:            |
|   https://github.com/dani-garcia/vaultwarden/issues/new            |
\--------------------------------------------------------------------/

After this PR:

/--------------------------------------------------------------------\
|                        Starting Vaultwarden                        |
|             Version main-7d7da921 2023-02-11 17:27:10              |
|--------------------------------------------------------------------|
| This is an *unofficial* Bitwarden implementation, DO NOT use the   |
| official channels to report bugs/features, regardless of client.   |
| Send usage/configuration questions or feature requests to:         |
|   https://vaultwarden.discourse.group/                             |
| Report suspected bugs/issues in the software itself at:            |
|   https://github.com/dani-garcia/vaultwarden/issues/new            |
\--------------------------------------------------------------------/

Description:

  • Last tag is now optional.
  • Timestamp is added to version string.

Four types of version string are generated in build.rs:

  1. Main branch + last tag → {last_tag}-{rev_short} {commit_time}
  2. Main branch → main-{rev_short} {commit_time}
  3. Non-main branch + last tag → {last_tag}-{rev_short} ({branch}) {commit_time}
  4. Non-main branch → {rev_short} ({branch}) {commit_time}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/3240 **Author:** [@strump](https://github.com/strump) **Created:** 2/11/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`7d7da92`](https://github.com/dani-garcia/vaultwarden/commit/7d7da9212e42bfe91044c24e3fa41f10c571fba2) Last tag is now optional. Timestamp is added to version string. ### 📊 Changes **1 file changed** (+19 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `build.rs` (+19 -4) </details> ### 📄 Description Build script doesn't produce version string if no git history is available. **Steps to reproduce:** 1. Clone repo with **no history** (Mogenius.com does this): `git clone --depth 1 https://github.com/dani-garcia/vaultwarden.git` 2. Build docker image: `docker build --build-arg DB=sqlite -f docker/amd64/Dockerfile -t vaultwarden:local .` 3. Run it: `docker run -it --rm vaultwarden:local` **Actual result**: no version information in output ``` /--------------------------------------------------------------------\ | Starting Vaultwarden | |--------------------------------------------------------------------| | This is an *unofficial* Bitwarden implementation, DO NOT use the | | official channels to report bugs/features, regardless of client. | | Send usage/configuration questions or feature requests to: | | https://vaultwarden.discourse.group/ | | Report suspected bugs/issues in the software itself at: | | https://github.com/dani-garcia/vaultwarden/issues/new | \--------------------------------------------------------------------/ ``` **After this PR:** ``` /--------------------------------------------------------------------\ | Starting Vaultwarden | | Version main-7d7da921 2023-02-11 17:27:10 | |--------------------------------------------------------------------| | This is an *unofficial* Bitwarden implementation, DO NOT use the | | official channels to report bugs/features, regardless of client. | | Send usage/configuration questions or feature requests to: | | https://vaultwarden.discourse.group/ | | Report suspected bugs/issues in the software itself at: | | https://github.com/dani-garcia/vaultwarden/issues/new | \--------------------------------------------------------------------/ ``` **Description:** * Last tag is now optional. * Timestamp is added to version string. Four types of version string are generated in build.rs: 1. Main branch + last tag → `{last_tag}-{rev_short} {commit_time}` 2. Main branch → `main-{rev_short} {commit_time}` 3. Non-main branch + last tag → `{last_tag}-{rev_short} ({branch}) {commit_time}` 4. Non-main branch → `{rev_short} ({branch}) {commit_time}` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:42:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#3248
No description provided.