Skip to content

Commit 8f26c7e

Browse files
committed
Swift: add one more help link to diagnostics
1 parent e17a8d0 commit 8f26c7e

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

swift/integration-tests/osx-only/autobuilder/failure/diagnostics.expected

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning"
3+
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4+
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
45
],
56
"plaintextMessage": "The detected build command failed (tried /usr/bin/xcodebuild build -project <test-root-directory>/hello-failure.xcodeproj -target hello-failure CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO).\n\nSet up a manual build command.",
67
"severity": "error",

swift/integration-tests/osx-only/autobuilder/no-build-system/diagnostics.expected

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning"
3+
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4+
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
45
],
56
"plaintextMessage": "No Xcode project or workspace was found.\n\nSet up a manual build command.",
67
"severity": "error",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <string_view>
2+
3+
namespace codeql_diagnostics {
4+
constexpr std::string_view customizingBuildAction = "Set up a manual build command";
5+
constexpr std::string_view customizingBuildHelpLinks =
6+
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/"
7+
"automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning "
8+
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/"
9+
"automatically-scanning-your-code-for-vulnerabilities-and-errors/"
10+
"configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-"
11+
"language";
12+
} // namespace codeql_diagnostics

swift/xcode-autobuilder/XcodeBuildRunner.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
#include "absl/strings/str_join.h"
77

88
#include "swift/logging/SwiftLogging.h"
9+
#include "swift/xcode-autobuilder/CustomizingBuildDiagnostics.h"
910

1011
namespace codeql_diagnostics {
1112
constexpr codeql::SwiftDiagnosticsSource build_command_failed{
12-
"build_command_failed",
13-
"Detected build command failed",
14-
"Set up a manual build command",
15-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/"
16-
"automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
17-
};
13+
"build_command_failed", "Detected build command failed", customizingBuildAction,
14+
customizingBuildHelpLinks};
1815
}
1916

2017
static codeql::Logger& logger() {

swift/xcode-autobuilder/XcodeProjectParser.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010
#include "swift/xcode-autobuilder/XcodeWorkspaceParser.h"
1111
#include "swift/xcode-autobuilder/CFHelpers.h"
1212
#include "swift/logging/SwiftLogging.h"
13+
#include "swift/xcode-autobuilder/CustomizingBuildDiagnostics.h"
1314

1415
namespace codeql_diagnostics {
1516
constexpr codeql::SwiftDiagnosticsSource no_project_found{
16-
"no_project_found",
17-
"No Xcode project or workspace detected",
18-
"Set up a manual build command",
19-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/"
20-
"automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
21-
};
17+
"no_project_found", "No Xcode project or workspace detected", customizingBuildAction,
18+
customizingBuildHelpLinks};
2219
} // namespace codeql_diagnostics
2320

2421
namespace fs = std::filesystem;

0 commit comments

Comments
 (0)