question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using -Preckon.stage=final on a clean tagged commit, the reckoned version becomes the next available version.

See original GitHub issue

We’re attempting to run gradle assemble -Preckon.stage=final on tagged commits to build the version that was tagged.

reckon {
  scopeFromProp()
  snapshotFromProp()
}

When not using the final flag, the reckoned version matches the tag on the current commit.

✔ ~/PROJECT [v0.5.2|✔]
$ ./gradlew app:assemble

> Configure project :app
Reckoned version: 0.5.2

However, with the final flag, Reckon increments the version number instead.

✔ ~/Project [v0.5.2|✔]
$ ./gradlew app:assemble -Preckon.stage=final

> Configure project :app
Reckoned version: 0.5.3

The final behavior seems odd in this later case, we’d expect final build on a clean tagged commit to produce the same versioned release build as tagged.

We can resort to using the default command to build a release build matching the tag, but there’s a slight caveat here. If the repo is dirty in anyway (CI script dropping a few temp files in the source repo), then the default command will bump the version to v0.5.3-SNAPSHOT where as -Preckon.stage=final could’ve caught this and not allow a dynamic version change during automated builds.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ajoberstarcommented, Feb 13, 2022

It appears I didn’t mention this explicitly, so to ensure people are aware… To build an existing tag without incrementing the version again, provide no input. Omit both the stage and scope and it will pick up the version already tagged. This is the exact approach used by reckon’s own release process (see the .GitHub/workflows/release.yaml) and note that I don’t provide either property to the build.

If you want added assurance that it’s a rebuild, use a task like the assert one noted above.

1reaction
bowenwpcommented, Feb 14, 2020

Thanks for the quick response.

Yes, I think that’s the correct interpretation.

To provide more context, our specific use case is building the release builds from CI hosts and to trigger the release builds off version tags. Therefore, when the builds were executed, the tag specifying the version is checked out and we want to make sure the build off that tag is always the same version. Therefore, we do want to assert it is a rebuild of the tag and not a version bump.

Is keeping the source directory clean sufficient condition to ensure the default command build the version of the tag? We would love to have final’s behavior of failing on a dirty repo as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reckon...is this week's muse - Culture of Code
Bump the version number. Merge and delete the release branch. Tag the release. What a waste of time. If you're building a project...
Read more >
reckon - Bountysource
The problem we are having is that we tag using Reckon and the changes to this ... on a clean tagged commit, the...
Read more >
Reckoned version 0.1.0-beta.1 is (and cannot be) less than ...
23 , For build stage we are using gradle with rackon to create tag and then pushing that tag with normal git push...
Read more >
PhpStorm - Use tags to mark specific Git commits - JetBrains
For example, you can tag a commit that corresponds to a release ... The tag will be shown in the Log tab of...
Read more >
Git tagging - A brief guide - by Srebalaji Thirumalai - Git Better
Most people use tagging to mark a specific release in the project. ... the tag that was already created will be replaced with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found