Skip to content

Commit

Permalink
Merge pull request #1916 from tgstation/TelemFix [TGSDeploy]
Browse files Browse the repository at this point in the history
Fix version reporting telemetry not creating directory
  • Loading branch information
Cyberboss authored Aug 29, 2024
2 parents 77c9f24 + 0c0372d commit 29993cf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2156,9 +2156,17 @@ jobs:
- name: Parse TGS version
run: echo "TGS_VERSION=$(xmlstarlet sel -N X="http://schemas.microsoft.com/developer/msbuild/2003" --template --value-of /X:Project/X:PropertyGroup/X:TgsCoreVersion build/Version.props)" >> $GITHUB_ENV

- name: Generate App Token
id: app-token-generation
uses: actions/create-github-app-token@v1
with:
repositories: tgstation-ppa
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Trigger tgstation-ppa workflow
run: |
curl -XPOST -u "${{ vars.DEV_PUSH_USERNAME }}:${{ secrets.DEV_PUSH_TOKEN }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/tgstation/tgstation-ppa/actions/workflows/add_tgs_version.yml/dispatches --data '{"ref":"main","inputs":{"tgs_semver": "${{ env.TGS_VERSION }}"}}'
curl -XPOST -u "tgstation-server-ci:${{ steps.app-token-generation.outputs.token }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/tgstation/tgstation-ppa/actions/workflows/add_tgs_version.yml/dispatches --data '{"ref":"main","inputs":{"tgs_semver": "${{ env.TGS_VERSION }}"}}'
deploy-winget:
name: Deploy TGS (winget)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/update-ss13-org-mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: actions/create-github-app-token@v1
with:
owner: spacestation13
repositories: tgstation-server
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

Expand Down
2 changes: 1 addition & 1 deletion build/Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Integration tests will ensure they match across the board -->
<Import Project="WebpanelVersion.props" />
<PropertyGroup>
<TgsCoreVersion>6.9.1</TgsCoreVersion>
<TgsCoreVersion>6.9.2</TgsCoreVersion>
<TgsConfigVersion>5.2.0</TgsConfigVersion>
<TgsApiVersion>10.7.0</TgsApiVersion>
<TgsCommonLibraryVersion>7.0.0</TgsCommonLibraryVersion>
Expand Down
4 changes: 3 additions & 1 deletion src/Tgstation.Server.Host/Core/VersionReportingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,17 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)

try
{
var telemetryIdDirectory = ioManager.GetPathInLocalDirectory(assemblyInformationProvider);
var telemetryIdFile = ioManager.ResolvePath(
ioManager.ConcatPath(
ioManager.GetPathInLocalDirectory(assemblyInformationProvider),
telemetryIdDirectory,
"telemetry.id"));

Guid telemetryId;
if (!await ioManager.FileExists(telemetryIdFile, stoppingToken))
{
telemetryId = Guid.NewGuid();
await ioManager.CreateDirectory(telemetryIdDirectory, stoppingToken);
await ioManager.WriteAllBytes(telemetryIdFile, Encoding.UTF8.GetBytes(telemetryId.ToString()), stoppingToken);
logger.LogInformation("Generated telemetry ID {telemetryId} and wrote to {file}", telemetryId, telemetryIdFile);
}
Expand Down

0 comments on commit 29993cf

Please sign in to comment.