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

Use latest tag to retrieve versionCode for nightly releases #5056

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

malmstein
Copy link
Contributor

@malmstein malmstein commented Sep 24, 2024

Task/Issue URL: https://app.asana.com/0/1174433894299346/1208382292008137/f

Description

Steps to test this PR

Nightly

  • ./gradlew getBuildVersionCode -PversionNameSuffix=-nightly
  • Verify that versionCode increments (Previous code was 5, incrementing to 6)

Production

  • ./gradlew getBuildVersionCode
  • Verify that versionCode is 0

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @malmstein and the rest of your teammates on Graphite Graphite

@malmstein malmstein changed the title use latest tag to retrieve versionCode for nightly releases Use latest tag to retrieve versionCode for nightly releases Sep 24, 2024
@malmstein malmstein marked this pull request as ready for review September 24, 2024 15:33
Copy link
Member

@CDRussell CDRussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see this working, in that it returns a build number higher than the last tag, but the build ends in a failure. Both of these end in a failure:

  • ./gradlew getBuildVersionCode -PversionNameSuffix=-nightly
  • ./gradlew getBuildVersionCode

The reason for the failure is that your changes aren't compatible with gradle configuration caching. I can workaround it by forcing disabling the config cache (e.g., ./gradlew getBuildVersionCode -PversionNameSuffix=-nightly -Dorg.gradle.configuration-cache=false) but doesn't seem right that would be required.

Can you look into what's happening here, and if there's a better way of getting the job to finish successfully that doesn't require disabling the config cache with that param?

This is a nightly release, incrementing from previous release...
Last tag 5.215.0.12-nightly
 was a nightly release, incrementing from previous one...
Previous code was 12, incrementing to 13
13
FAILURE: Build failed with an exception.

* Where:
Script '/Users/craig/dev/source/ddg/Android/versioning.gradle' line: 37

* What went wrong:
Configuration cache problems found in this build.

4 problems were found storing the configuration cache, 2 of which seem unique.
- Script 'versioning.gradle': line 37: external process started 'git rev-list --tags --max-count=1'
  See https://docs.gradle.org/8.8/userguide/configuration_cache.html#config_cache:requirements:external_processes
- Script 'versioning.gradle': line 39: external process started 'git describe --tags 87492075b6ef4db8c015b000b64bb789c291dca2
'
  See https://docs.gradle.org/8.8/userguide/configuration_cache.html#config_cache:requirements:external_processes

See the complete report at file:///Users/craig/dev/source/ddg/Android/build/reports/configuration-cache/3ew6l1z4n7n4ky4aqqi9c1otr/1i7lwo9tqbqc92v4cmtarf0o4/configuration-cache-report.html
> Starting an external process 'git rev-list --tags --max-count=1' during configuration time is unsupported.
> Starting an external process 'git describe --tags 87492075b6ef4db8c015b000b64bb789c291dca2
  ' during configuration time is unsupported.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

@malmstein
Copy link
Contributor Author

malmstein commented Oct 1, 2024

Interesting @CDRussell . I don’t have gradle configuration cache disabled and the build is not failing for me.

> Task :app:getBuildVersionCode
This is a nightly release, incrementing from previous release...
Last tag 5.215.0.12-nightly
 was a nightly release, incrementing from previous one...
Previous code was 12, incrementing to 13
13
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 4s

@malmstein malmstein force-pushed the feature/david/09-24-use_latest_tag_to_retrieve_versioncode_for_nightly_releases branch from 85c6e56 to 7efc5fb Compare October 1, 2024 20:43
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