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

Consolidate/deprecate update_version.sh scripts and adjust VERSION #1815

Closed
rocodes opened this issue Feb 9, 2024 · 1 comment · Fixed by #1833
Closed

Consolidate/deprecate update_version.sh scripts and adjust VERSION #1815

rocodes opened this issue Feb 9, 2024 · 1 comment · Fixed by #1833
Assignees
Labels
⚙️ Tooling Improving maintainability and increasing maintainer joy : )

Comments

@rocodes
Copy link
Contributor

rocodes commented Feb 9, 2024

Description

Post monorepo / debianization refactor: The individual components still have update_version.sh, and I wonder if we can DRY that up a little, or deprecate it. Also, I noticed that a component's idea of its version is wrong (the VERSION file is not updated when we build-debs.sh) but maybe this is WIP.

Steps to Reproduce

(first issue) Visual observation of files
(second issue) build-debs.sh and observe 0.9.0 debs being built. then inspect VERSION in a component and notice a different number (eg 0.3.0 for securedrop-export).

Expected Behavior

  • Version number is consistent
  • update_version.sh only in one place, if we keep it, or removed

Actual Behavior

Please provide screenshots where appropriate.

Comments

Suggestions to fix, any other relevant information.

@rocodes rocodes added the ⚙️ Tooling Improving maintainability and increasing maintainer joy : ) label Feb 9, 2024
@legoktm legoktm self-assigned this Feb 13, 2024
@legoktm legoktm moved this to In Progress in SecureDrop dev cycle Feb 13, 2024
@legoktm
Copy link
Member

legoktm commented Feb 14, 2024

The plan is that there is one version going forwards, that applies to all the components. So we don't need individual update scripts anymore, that can be consolidated.

Now, there are a few places where the version is being used in a user facing way:

client/securedrop_client/gui/main.py
30:from securedrop_client import __version__, state
65:        self.setWindowTitle(_("SecureDrop Client {}").format(__version__))

client/securedrop_client/gui/auth/dialog.py
36:from securedrop_client import __version__ as sd_version
130:        application_version = QLabel(_("SecureDrop Client v{}").format(sd_version))

export/securedrop_export/main.py
19:from securedrop_export import __version__
51:        logger.info("Starting SecureDrop Export {}".format(__version__))

Presumably the export case isn't as important and just for internal debugging but I think it should be reasonable to keep. I think there are two ways we can handle this:

  1. Have a new update_version.sh script that continues to update __version__ in the components that need it.
  2. Have the package build process inject the version at build time, which prevents any wrong versions from coming in.

I think no. 2 is more "pure" as a solution but it's also more magical and it doesn't work properly in dev. No. 1 is also what we've basically done so far so I'm inclined to implement it for now. PR incoming shortly.

legoktm added a commit that referenced this issue Feb 14, 2024
There is now a single `update_version.sh` script that updates the
`__version__` variables in the client and export components and
increments the debian/changelog file.

The proxy version is hardcoded since it's going away as part of proxy v2
(also the usage in the response object was dubious to begin with).

Fixes #1815.
legoktm added a commit that referenced this issue Feb 21, 2024
There is now a single `update_version.sh` script that updates the
`__version__` variables in the client and export components and
increments the debian/changelog file.

The proxy version is hardcoded since it's going away as part of proxy v2
(also the usage in the response object was dubious to begin with).

Fixes #1815.
@github-project-automation github-project-automation bot moved this from In Progress to Done in SecureDrop dev cycle Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Tooling Improving maintainability and increasing maintainer joy : )
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants