read_image_version assigns only a single sigit for the patch version
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 35/100
Research direction
Inspect read_image_version in lib/shared-functions.sh, then run the provided reproduction script with config/version set to 3.5.13. Verify that IMAGE_VERSION_PATCH contains the complete patch number, including both digits, while the other version components and supported suffixes still parse correctly.
Written by the indexing model from the issue text.
Description
Steps to Reproduce
- Have installed an overleaf image with patch version greater then 9 (ex. 3.5.13)
- Use a script to run the function
read_image_versionfromlib/shared-functions.sh - Read the
$IMAGE_VERSION_PATCHvariable
Example code : (the file must be in the toolkit root to work)
#!/bin/bash
TOOLKIT_ROOT="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
source lib/shared-functions.sh
sudo echo 3.5.13 | sudo tee config/version
read_image_version
echo "$IMAGE_VERSION_MAJOR.$IMAGE_VERSION_MINOR.$IMAGE_VERSION_PATCH"
Expected Behaviour
The variable IMAGE_VERSION_PATCH should be the whole number (ex. 13) and not only the last digit (ex. 3)
Observed Behaviour
The variable $IMAGE_VERSION_PATCH contains only the last digit (ex.3)
Context
I was creating a script to automate my upgrade from overleaf version 3.0.1 to the latest (5.2.1).
While doing that i used shared-functions.sh to access it's functions and i needed to check the image version before upgrading to version 4.0.1 (needs image version > 3.5.10)
Technical Info
This is using the latest version of the toolkit
- Operating System and version (desktop or mobile): Ubuntu server 20.04
- Project and/or file: lib/shared-functions.sh
Analysis:
The problem is that the regex used in read_image_version is wrong.
Current regex: ^([0-9]+)\.([0-9]+)\.([0-9])+(-RC[0-9]*)?(-with-texlive-full)?$
Right regex: ^([0-9]+)\.([0-9]+)\.([0-9]+)+(-RC[0-9]*)?(-with-texlive-full)?$
The only difference is the + after the third number's regex.
You can test the regex only using websites like: https://regex101.com/
- Dominant language
- Shell
- Stars
- 1.3k
- Forks
- 310
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from overleaf/toolkit
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
All issues in overleaf/toolkit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
community-scripts/ProxmoxVE#17425 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ll7/robot_sf_ll7#9560 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·