-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix dev versions #903
fix dev versions #903
Conversation
8b77848
to
2618e97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
To quickly recap why we need to do make this change: while the Mac installer will simply install whatever app our API returns, the Windows Squirrel installer compares the installed version with the new version provided by the API. The new bundle is only installed if the provided version is higher according to some NuGet logic (presumably covered by these docs). Version numbers derived from git hashes cannot be reliably compared, whereas this approach can.
The one thing I take issue with (I've already discussed this with @bcotrim), is this part:
After releasing a version (e.g., 1.3.3), we should immediately update package.json to the next intended version (e.g., 1.3.4). This ensures dev builds are correctly labeled with the version they're working towards (e.g., 1.3.4-dev1) rather than appearing as development builds of the just-released version.
Committing a new version number in package.json
currently triggers a release build on CI. Changing that seems overly cumbersome for this purpose, so I suggest we accept the quirk that v1.3.3-dev24
is newer than v1.3.3
. This is in fact a "problem" we already have with our existing dev version format, so we can tackle that separately (if needed)
src/updates.ts
Outdated
process.env.NODE_ENV === 'production' && app.isPackaged && ! app.getVersion().includes( '-dev.' ); | ||
process.env.NODE_ENV === 'production' && | ||
app.isPackaged && | ||
! /(-dev\.|-dev\d+)/.test( app.getVersion() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely necessary, but it might be nice to add an isDevRelease
utility function for checking a version string. Could be used here and in src/lib/sentry-release.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes a lot of sense, added! 👍
fastlane/Fastfile
Outdated
puts "\n=== Starting notarization process ===" | ||
|
||
Dir[File.join(BUILDS_FOLDER, '**', 'Studio.app')].each do |path| | ||
puts "\nChecking app bundle at: #{path}" | ||
|
||
# Check Info.plist contents | ||
info_plist_path = File.join(path, 'Contents', 'Info.plist') | ||
puts "\nInfo.plist path: #{info_plist_path}" | ||
|
||
if File.exist?(info_plist_path) | ||
puts "\nInfo.plist contents:" | ||
puts "CFBundleVersion: #{`/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' "#{info_plist_path}" 2>&1`.strip}" | ||
puts "CFBundleShortVersionString: #{`/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "#{info_plist_path}" 2>&1`.strip}" | ||
puts "CFBundleIdentifier: #{`/usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' "#{info_plist_path}" 2>&1`.strip}" | ||
else | ||
puts "Warning: Info.plist not found at #{info_plist_path}" | ||
end | ||
|
||
puts "\nAttempting to notarize app bundle..." | ||
notarize( | ||
package: path, | ||
api_key_path: APPLE_API_KEY_PATH | ||
) | ||
puts "Notarization completed for app bundle" | ||
end | ||
|
||
Dir[File.join(BUILDS_FOLDER, '**', 'Studio-*.dmg')].each do |path| | ||
puts "\nAttempting to notarize DMG at: #{path}" | ||
notarize( | ||
bundle_id: APPLE_BUNDLE_IDENTIFIER, | ||
package: path, | ||
api_key_path: APPLE_API_KEY_PATH | ||
) | ||
puts "Notarization completed for DMG" | ||
end | ||
|
||
puts "\n=== Notarization process completed ===" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these changes? Seems like it's all just logging calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this. I was getting some errors and added those lines as debug.
I cleaned up now.
Related issues
The reported issue is caused by an error while parsing the commit hash in the dev builds.
This PR suggest a change that makes dev builds follow a correct versioning convention by using
-dev${number}
format.We currently already follow that convention on other builds, for example,
-beta1
,-beta2
, etc...By using the commit count since the latest release we maintain the ability to track which commit generated that version.
Notes:
studio-app/updates
endpoint.1.3.3
), we should immediately updatepackage.json
to the next intended version (e.g.,1.3.4
). This ensures dev builds are correctly labeled with the version they're working towards (e.g.,1.3.4-dev1
) rather than appearing as development builds of the just-released version.Proposed Changes
New dev version on macOS:
![image](https://private-user-images.githubusercontent.com/8320845/410936977-c2304628-d915-4d4b-ac9f-a9777b83d0ef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NDc1ODQsIm5iZiI6MTczOTU0NzI4NCwicGF0aCI6Ii84MzIwODQ1LzQxMDkzNjk3Ny1jMjMwNDYyOC1kOTE1LTRkNGItYWM5Zi1hOTc3N2I4M2QwZWYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMTUzNDQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmUzODUxZWZlMzI0YjAwMTRhMjIyODhiNmYxNDllMDJkOWQ0N2JhMTg2NTFmNjFjOTU5YjdjNmFhNjlmZmI5NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.MTAaW_Z18TJhpkbuuCd2ND6ggSextIodHt7K2pMxKLc)
New dev version on Windows:
![image](https://private-user-images.githubusercontent.com/8320845/410937727-f4c4f991-65fa-4e4a-bf59-9048d8c54e90.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NDc1ODQsIm5iZiI6MTczOTU0NzI4NCwicGF0aCI6Ii84MzIwODQ1LzQxMDkzNzcyNy1mNGM0Zjk5MS02NWZhLTRlNGEtYmY1OS05MDQ4ZDhjNTRlOTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMTUzNDQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWRhZWYzMWU1MjVkYjQ5ZDE3OTMwOTI4MzNlZGZmOTZhNjdjMTAwYmE3Mjc4M2I2YzI0NTU1MGQ4OTE3MTk2MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.RcEtwfS8T99GuEu8cmrV-stL6stdTFN09oYxe-uzkro)
Testing Instructions
cat package.json | grep version
cat out/releases.json | jq
DRY_RUN=true BUILDKITE_BUILD_NUMBER=test-build bundle exec fastlane distribute_dev_build
Pre-merge Checklist