Skip to content

Commit

Permalink
PR feedback; fix e2e test url
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMcPMS committed Oct 8, 2024
1 parent c540b7f commit 81d5dfe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/windows/package-manager/winget/returnCodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ ms.localizationpriority: medium
| 0x8A150083 | -1978335101 | APPINSTALLER_CLI_ERROR_LICENSING_API_FAILED | Failed to retrieve Microsoft Store package license. |
| 0x8A150084 | -1978335100 | APPINSTALLER_CLI_ERROR_SFSCLIENT_PACKAGE_NOT_SUPPORTED | The Microsoft Store package does not support download command. |
| 0x8A150085 | -1978335099 | APPINSTALLER_CLI_ERROR_LICENSING_API_FAILED_FORBIDDEN | Failed to retrieve Microsoft Store package license. The Microsoft Entra Id account does not have required privilege. |
| 0x8A150086 | -1978335098 | APPINSTALLER_CLI_ERROR_INSTALLER_ZERO_BYTE_FILE | Downloaded zero byte installer; ensure that your network connection is working properly. |

## Install errors.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Publisher: Microsoft Corporation
License: Test
Installers:
- Architecture: x86
InstallerUrl: https://localhost:5001/TestKit/empty
InstallerUrl: https://localhost:5001/TestKit/TestData/empty
InstallerType: exe
InstallerSha256: E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
ManifestType: singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Publisher: Microsoft Corporation
License: Test
Installers:
- Architecture: x86
InstallerUrl: https://localhost:5001/TestKit/empty
InstallerUrl: https://localhost:5001/TestKit/TestData/empty
InstallerType: exe
InstallerSha256: BAD0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852BBAD
ManifestType: singleton
Expand Down
12 changes: 8 additions & 4 deletions src/AppInstallerCommonCore/AppInstallerTelemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,10 @@ namespace AppInstaller::Logging
uint64_t downloadSizeInBytes,
const std::optional<std::string>& contentType) const noexcept
{
std::string actualContentType = contentType.value_or(std::string{});

if (IsTelemetryEnabled())
{
std::string actualContentType = contentType.value_or(std::string{});

AICLI_TraceLoggingWriteActivity(
"HashMismatch",
TraceLoggingUInt32(m_subExecutionId, "SubExecutionId"),
Expand All @@ -563,7 +563,7 @@ namespace AppInstaller::Logging
TraceLoggingBinary(expected.data(), static_cast<ULONG>(expected.size()), "Expected"),
TraceLoggingBinary(actual.data(), static_cast<ULONG>(actual.size()), "Actual"),
TraceLoggingBool(overrideHashMismatch, "Override"),
TraceLoggingUInt64(downloadSizeInBytes, "FileSize"),
TraceLoggingUInt64(downloadSizeInBytes, "ActualSize"),
AICLI_TraceLoggingStringView(actualContentType, "ContentType"),
TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance),
TraceLoggingKeyword(MICROSOFT_KEYWORD_CRITICAL_DATA));
Expand All @@ -576,6 +576,8 @@ namespace AppInstaller::Logging
m_summary.HashMismatchExpected = expected;
m_summary.HashMismatchActual = actual;
m_summary.HashMismatchOverride = overrideHashMismatch;
m_summary.HashMismatchActualSize = downloadSizeInBytes;
m_summary.HashMismatchContentType = actualContentType;
}
}

Expand All @@ -584,7 +586,7 @@ namespace AppInstaller::Logging
<< Utility::SHA256::ConvertToString(expected)
<< "] does not match download ["
<< Utility::SHA256::ConvertToString(actual)
<< ']');
<< "] with file size [" << downloadSizeInBytes << "] and content type [" << actualContentType << "]");
}

void TelemetryTraceLogger::LogInstallerFailure(std::string_view id, std::string_view version, std::string_view channel, std::string_view type, uint32_t errorCode) const noexcept
Expand Down Expand Up @@ -818,6 +820,8 @@ namespace AppInstaller::Logging
TraceLoggingBinary(m_summary.HashMismatchExpected.data(), static_cast<ULONG>(m_summary.HashMismatchExpected.size()), "HashMismatchExpected"),
TraceLoggingBinary(m_summary.HashMismatchActual.data(), static_cast<ULONG>(m_summary.HashMismatchActual.size()), "HashMismatchActual"),
TraceLoggingBool(m_summary.HashMismatchOverride, "HashMismatchOverride"),
TraceLoggingUInt64(m_summary.HashMismatchActualSize, "HashMismatchActualSize"),
AICLI_TraceLoggingStringView(m_summary.HashMismatchContentType, "HashMismatchContentType"),
AICLI_TraceLoggingStringView(m_summary.InstallerExecutionType, "InstallerExecutionType"),
TraceLoggingUInt32(m_summary.InstallerErrorCode, "InstallerErrorCode"),
AICLI_TraceLoggingStringView(m_summary.UninstallerExecutionType, "UninstallerExecutionType"),
Expand Down
2 changes: 2 additions & 0 deletions src/AppInstallerCommonCore/Public/AppInstallerTelemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ namespace AppInstaller::Logging
std::vector<uint8_t> HashMismatchExpected;
std::vector<uint8_t> HashMismatchActual;
bool HashMismatchOverride = false;
uint64_t HashMismatchActualSize = 0;
std::string HashMismatchContentType;

// LogInstallerFailure
std::string InstallerExecutionType;
Expand Down

0 comments on commit 81d5dfe

Please sign in to comment.