Skip to content

Commit 7254e36

Browse files
authored
LT-22298 Attempt 3: standardise base_build_number (#498)
The variable `BaseBuildish` from Jenkins builds was inappropriately named, so it was renamed to `base_build_number` in most places. Update stragglers. * Include the Base Build Number in error reports
1 parent 20ca049 commit 7254e36

3 files changed

Lines changed: 18 additions & 34 deletions

File tree

.github/workflows/patch-installer-cd.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ on:
3434
description: 'Commit-ish for liblcm repository'
3535
required: false
3636
default: 'master'
37-
# default should be changed to the most recent base release for the release cycle
37+
# default should be changed to the most recent base release for the release cycle.
38+
# After 9.3 is stable, base_release can be computed from base_build_number, but they need to be independent for bootstrapping patches
39+
# on Jenkins-built bases.
3840
base_release:
39-
description: 'The github release for the base build artifacts'
40-
default: 'build-1182' # When updating this, update fallbacks below, too.
41+
description: 'The github release for the base build artifacts (separate only for bootstrapping; should be removed after 9.3 is the stable)'
42+
default: 'build-1182' # When updating this, update base_build_number and their fallbacks below, too.
4143
base_build_number:
42-
description: 'The base build number (only for bootstrapping, should be removed after 9.3 is the stable)'
44+
description: 'The base build number'
4345
required: false
44-
default: ''
46+
default: '1182'
4547
make_release:
4648
description: 'Should the release be pushed to s3 - use false for test builds'
4749
required: false
@@ -115,14 +117,14 @@ jobs:
115117
fetch-depth: 0
116118
path: 'Localizations/LCM'
117119

118-
- name: Download 461 targeting pack
120+
- name: Download .NET 461 targeting pack
119121
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
120122
id: downloadfile # Remember to give an ID if you need the output filename
121123
with:
122124
url: "https://download.microsoft.com/download/F/1/D/F1DEB8DB-D277-4EF9-9F48-3A65D4D8F965/NDP461-DevPack-KB3105179-ENU.exe"
123125
target: public/
124126

125-
- name: Install targeting pack
127+
- name: Install .NET 461 targeting pack
126128
shell: cmd
127129
working-directory: public
128130
run: NDP461-DevPack-KB3105179-ENU.exe /q
@@ -207,6 +209,7 @@ jobs:
207209
id: build_installer
208210
shell: powershell
209211
run: |
212+
$base_build_number = "${{ inputs.base_build_number || '1182' }}"
210213
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\AppContext"
211214
cd Build
212215
.\build64.bat /t:BuildPatchInstaller "/property:config=release;action=test;desktopNotAvailable=true" /v:d /bl ^| tee-object -FilePath build.log
@@ -261,35 +264,13 @@ jobs:
261264
# Use inputs if defined but default to true
262265
if: ${{ (inputs.make_release || 'true') == 'true' }}
263266
shell: pwsh
264-
env:
265-
BASE_RELEASE: ${{ inputs.base_release || 'build-1182' }}
266-
BASE_BUILD_NUMBER: ${{ inputs.base_build_number || '' }}
267267
run: |
268-
# The github action base-installer-cd will make releases with a tag build-[build number].
269-
# Manually created releases with Jenkins artifacts need to use existing tags, so we need
270-
# to specify the base build number when we launch patches against Jenkins releases.
271-
if ($env:BASE_BUILD_NUMBER -and $env:BASE_BUILD_NUMBER.Trim() -ne "") {
272-
$baseBuildNumber = "_b$($env:BASE_BUILD_NUMBER)"
273-
} elseif ($env:BASE_RELEASE -and $env:BASE_RELEASE.Trim() -ne "") {
274-
if ($env:BASE_RELEASE -notmatch '^build-\d+$') {
275-
throw "BASE_RELEASE must start with 'build-' (got '$env:BASE_RELEASE')"
276-
}
277-
$baseBuildNumber = "_b$($env:BASE_RELEASE -replace '^build-','')"
278-
} else {
279-
throw "Must have a base_build_number or a valid base_release to support automatic updating"
280-
}
281268
$patchPath = "${{ steps.find_patch.outputs.patch_file }}"
282269
if (-not (Test-Path $patchPath)) {
283270
throw "Patch file not found at $patchPath"
284271
}
285272
$patchFile = Split-Path $patchPath -Leaf
286-
$patchDir = Split-Path $patchPath -Parent
287-
# Insert baseBuildNumber before _x64.msp necessary for Automatic Update code Src\Common\FwUtils\FwUpdater.cs
288-
if ($patchFile -notmatch '^(.*)(_x64\.msp)$') {
289-
throw "Unexpected patch filename format: $patchFile"
290-
}
291-
$patchWithBaseInName = "$($Matches[1])${baseBuildNumber}$($Matches[2])"
292-
$s3Key = "jobs/FieldWorks-Win-all-Release-Patch/$($env:FW_BUILD_NUMBER)/$patchWithBaseInName"
273+
$s3Key = "jobs/FieldWorks-Win-all-Release-Patch/$($env:FW_BUILD_NUMBER)/$patchFile"
293274
aws s3 cp $patchPath "s3://flex-updates/$s3Key"
294275
Write-Host "Uploaded to s3://flex-updates/$s3Key"
295276

Build/Installer.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@
434434
<PropertyGroup>
435435
<Arch Condition="'$(Platform)' != 'x64'">x86</Arch> <!-- Handle x86 and WIN32 -->
436436
<Arch Condition="'$(Platform)' == 'x64'">x64</Arch>
437-
<Base Condition="'$(BaseBuildish)' != ''">b$(BaseBuildish)_</Base>
437+
<Base Condition="'$(BASE_BUILD_NUMBER)' != ''">b$(BASE_BUILD_NUMBER)_</Base>
438438
</PropertyGroup>
439439

440440
<Target Name="BuildProductBaseMsi" DependsOnTargets="InstallerVersionNumbers">

Src/Common/FieldWorks/FieldWorks.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,10 +3566,13 @@ internal static IHelpTopicProvider GetHelpTopicProvider()
35663566
/// ------------------------------------------------------------------------------------
35673567
private static void SetupErrorReportInformation()
35683568
{
3569+
var version = Version;
35693570
var entryAssembly = Assembly.GetEntryAssembly();
3570-
var version = entryAssembly == null
3571-
? Version
3572-
: new VersionInfoProvider(entryAssembly, true).ApplicationVersion;
3571+
if (entryAssembly != null)
3572+
{
3573+
var vip = new VersionInfoProvider(entryAssembly, true);
3574+
version = $"{vip.ApplicationVersion} (Base build: {vip.BaseBuildNumber})";
3575+
}
35733576
if (version != null)
35743577
{
35753578
// The property "Version" would be overwritten when Palaso adds the standard properties

0 commit comments

Comments
 (0)