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

feat(version): Enhancements to Version Display Functionality #1107

Merged
merged 4 commits into from
May 13, 2024

Conversation

skrashevich
Copy link
Contributor

@skrashevich skrashevich commented May 12, 2024

Enhancements to Version Display Functionality

% ./go2rtc -version
go2rtc version 1.9.1.2(9004308): 2024-05-12 06:35:02 +0300 MSK darwin/arm64
                  ^version  ^commit               ^commit date       ^ binary arch

Overview

This pull request introduces several enhancements to the version display functionality within our go2rtc application. The goal of these changes is to provide more detailed build information which aids in better version tracking and debugging during development and deployment processes.

Key Changes

  1. Enhanced Version Output: The output format of the version command in the Init() function has been expanded to include the VCS revision hash and the build time. This additional information is fetched from build metadata, formatted, and displayed alongside the existing version details.

Implementation Details

  • The debug.ReadBuildInfo() function is used to access the current build's metadata.
  • Revision hash and build timestamp are extracted from the build info settings. If available, the revision hash is truncated to the first 7 characters for better readability.
  • Both the revision hash and the timestamp are then appended to the version string output, enhancing traceability of the build.

Benefits

  • Improved Traceability: Including the VCS revision and timestamp in the version output allows development teams to quickly identify and correlate specific builds with source control, enhancing overall traceability.
  • Ease of Use: Displaying more detailed version information directly within the application streamlines the process of version verification during troubleshooting and system checks.

This enhancement aligns with ongoing efforts to improve robustness and operational transparency across our development cycles. By integrating build-specific metadata directly into the version output, developers and system administrators can achieve greater insights into the deployment landscape without requiring additional tools or commands.

@AlexxIT AlexxIT self-assigned this May 12, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 12, 2024

It's a good idea, but the format is something to think about

skrashevich and others added 2 commits May 12, 2024 22:10
- Added shorthand flag support for `config`, `daemon`, and `version`
- Implemented dynamic version string generation using build info
- Updated flag usage output to include shorthand options and help command
@AlexxIT AlexxIT merged commit 0075145 into AlexxIT:master May 13, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 13, 2024

Thanks!

@AlexxIT AlexxIT added this to the v1.9.2 milestone May 13, 2024
@skrashevich skrashevich deleted the version-display-enhance branch May 17, 2024 21:18
@AlexxIT
Copy link
Owner

AlexxIT commented May 18, 2024

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.

2 participants