Skip to content

Commit 3d3008c

Browse files
chandrashritiiShriti Chandravinayakmsftadityashahms
authored
PCCR V1 | Add deprecation warning (#19586)
* Added deprecation warning in logs and classic UI for PCCR V1 task Signed-off-by: Shriti Chandra <[email protected]> * Resolve build failure Signed-off-by: Shriti Chandra <[email protected]> --------- Signed-off-by: Shriti Chandra <[email protected]> Co-authored-by: Shriti Chandra <[email protected]> Co-authored-by: Vinayak <[email protected]> Co-authored-by: Aditya Shah <[email protected]>
1 parent 63e9d5a commit 3d3008c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2476
-30
lines changed

Tasks/PublishCodeCoverageResultsV1/Strings/resources.resjson/en-US/resources.resjson

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"loc.friendlyName": "Publish code coverage results",
2+
"loc.friendlyName": "[To be deprecated] Publish code coverage",
33
"loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=626485)",
4-
"loc.description": "Publish Cobertura or JaCoCo code coverage results from a build",
4+
"loc.description": "[DEPRECATION WARNING! Users are recommended to switch to version 2*.] Publish Cobertura or JaCoCo code coverage results from a build",
55
"loc.instanceNameFormat": "Publish code coverage from $(summaryFileLocation)",
66
"loc.input.label.codeCoverageTool": "Code coverage tool",
7-
"loc.input.help.codeCoverageTool": "The tool with which code coverage results are generated.",
7+
"loc.input.help.codeCoverageTool": "[DEPRECATION WARNING! Users are recommended to switch to task version 2*. For more details, see https://devblogs.microsoft.com/devops/new-pccr-task.] The tool with which code coverage results are generated.",
88
"loc.input.label.summaryFileLocation": "Summary file",
99
"loc.input.help.summaryFileLocation": "Path of the summary file containing code coverage statistics, such as line, method, and class coverage. The value may contain minimatch patterns. For example: `$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura/coverage.xml`",
1010
"loc.input.label.pathToSources": "Path to Source files",
@@ -22,5 +22,6 @@
2222
"loc.messages.FailedToGenerateHtmlReport": "Failed to generate Html report. Error: %s",
2323
"loc.messages.IgnoringReportDirectory": "Ignoring coverage report directory with Html content as we are auto-generating Html content",
2424
"loc.messages.UpgradeAgentMessage": "Please upgrade your agent version. https://github.com/Microsoft/vsts-agent/releases",
25-
"loc.messages.GeneratedHtmlReport": "Generated code coverage html report: %s"
25+
"loc.messages.GeneratedHtmlReport": "Generated code coverage html report: %s",
26+
"loc.messages.V1TaskDeprecationNotice": "New V2 version of task publishing code coverage results is available to all our customers now. We highly recommend to stop using the V1 version and migrate to V2 version (https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2). For more details, see - https://devblogs.microsoft.com/devops/new-pccr-task."
2627
}

Tasks/PublishCodeCoverageResultsV1/publishcodecoverageresults.ts

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ async function run() {
1010
// Initialize localization
1111
tl.setResourcePath(path.join(__dirname, 'task.json'));
1212

13+
// Log warning for PCCR V1 task deprecation
14+
tl.warning(tl.loc('V1TaskDeprecationNotice'));
15+
1316
// Get input values
1417
const codeCoverageTool = tl.getInput('codeCoverageTool', true);
1518
const summaryFileLocation = tl.getInput('summaryFileLocation', true);

Tasks/PublishCodeCoverageResultsV1/task.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"id": "2A7EBC54-C13E-490E-81A5-D7561AB7CD97",
33
"name": "PublishCodeCoverageResults",
4-
"friendlyName": "Publish code coverage results",
5-
"description": "Publish Cobertura or JaCoCo code coverage results from a build",
4+
"friendlyName": "[To be deprecated] Publish code coverage",
5+
"description": "[DEPRECATION WARNING! Users are recommended to switch to version 2*.] Publish Cobertura or JaCoCo code coverage results from a build",
66
"helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-code-coverage-results",
77
"helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=626485)",
88
"category": "Test",
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 228,
19+
"Minor": 236,
2020
"Patch": 0
2121
},
2222
"demands": [],
@@ -29,7 +29,7 @@
2929
"label": "Code coverage tool",
3030
"required": true,
3131
"defaultValue": "JaCoCo",
32-
"helpMarkDown": "The tool with which code coverage results are generated.",
32+
"helpMarkDown": "[DEPRECATION WARNING! Users are recommended to switch to task version 2*. For more details, see https://devblogs.microsoft.com/devops/new-pccr-task.] The tool with which code coverage results are generated.",
3333
"options": {
3434
"Cobertura": "Cobertura",
3535
"JaCoCo": "JaCoCo"
@@ -99,6 +99,7 @@
9999
"FailedToGenerateHtmlReport": "Failed to generate Html report. Error: %s",
100100
"IgnoringReportDirectory": "Ignoring coverage report directory with Html content as we are auto-generating Html content",
101101
"UpgradeAgentMessage": "Please upgrade your agent version. https://github.com/Microsoft/vsts-agent/releases",
102-
"GeneratedHtmlReport": "Generated code coverage html report: %s"
102+
"GeneratedHtmlReport": "Generated code coverage html report: %s",
103+
"V1TaskDeprecationNotice": "New V2 version of task publishing code coverage results is available to all our customers now. We highly recommend to stop using the V1 version and migrate to V2 version (https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2). For more details, see - https://devblogs.microsoft.com/devops/new-pccr-task."
103104
}
104105
}

Tasks/PublishCodeCoverageResultsV1/task.loc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 228,
19+
"Minor": 236,
2020
"Patch": 0
2121
},
2222
"demands": [],
@@ -99,6 +99,7 @@
9999
"FailedToGenerateHtmlReport": "ms-resource:loc.messages.FailedToGenerateHtmlReport",
100100
"IgnoringReportDirectory": "ms-resource:loc.messages.IgnoringReportDirectory",
101101
"UpgradeAgentMessage": "ms-resource:loc.messages.UpgradeAgentMessage",
102-
"GeneratedHtmlReport": "ms-resource:loc.messages.GeneratedHtmlReport"
102+
"GeneratedHtmlReport": "ms-resource:loc.messages.GeneratedHtmlReport",
103+
"V1TaskDeprecationNotice": "ms-resource:loc.messages.V1TaskDeprecationNotice"
103104
}
104105
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Default|1.228.0
2-
Node20_229_4|1.231.0
1+
Default|1.236.0
2+
Node20_229_4|1.236.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Publish Code Coverage Results
2+
3+
### Overview
4+
The Publish Code Coverage Results task is used to publish the code coverage results of a build.
5+
6+
### The different parameters of the task are explained below:
7+
8+
- **Code Coverage Tool:** Required Field. The tool with which code coverage results are generated.
9+
10+
- **Summary File:** Required Field. The path of the summary file containing code coverage statistics, such as line, method, and class coverage. The value may contain minimatch patterns. For example: `$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura/coverage.xml`
11+
12+
- **Report Directory:** The path of the code coverage HTML report directory. The report directory is published for later viewing as an artifact of the build. The value may contain minimatch patterns. For example: `$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura`
13+
14+
- **Additional Files:** The file path pattern specifying any additional code coverage files to be published as artifacts of the build. The value may contain minimatch patterns. For example: `$(System.DefaultWorkingDirectory)/**/*.exec`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"loc.friendlyName": "Code Coverage-Ergebnisse veröffentlichen",
3+
"loc.helpMarkDown": "[Weitere Informationen zu dieser Aufgabe](https://go.microsoft.com/fwlink/?LinkID=626485)",
4+
"loc.description": "Veröffentlicht Cobertura- oder JaCoCo-Code Coverage-Ergebnisse von einem Build.",
5+
"loc.instanceNameFormat": "Code Coverage veröffentlichen von $(summaryFileLocation)",
6+
"loc.input.label.codeCoverageTool": "Code Coverage-Tool",
7+
"loc.input.help.codeCoverageTool": "Das Tool, mit dem die Code Coverage-Ergebnisse generiert werden.",
8+
"loc.input.label.summaryFileLocation": "Zusammenfassungsdatei",
9+
"loc.input.help.summaryFileLocation": "Der Pfad der Zusammenfassungsdatei mit der Code Coverage-Statistik, z. B. Zeile, Methode und Klassenabdeckung. Der Wert enthält unter Umständen Minimatch-Muster. Beispiel: \"$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura/coverage.xml\"",
10+
"loc.input.label.pathToSources": "Pfad zu Quelldateien",
11+
"loc.input.help.pathToSources": "Der Pfad zu den Quelldateien ist erforderlich, wenn Coverage-XML-Berichte keinen absoluten Pfad zu den Quelldateien enthalten. Beispielsweise verwenden JaCoCo-Berichte keine absoluten Pfade, und beim Veröffentlichen der JaCoCo-Coveragedaten für Java-Apps würde das Muster in etwa folgendermaßen lauten: \"$(System.DefaultWorkingDirectory)/MyApp/src/main/java/\". <br />diese Eingabe ist auch erforderlich, wenn Tests in einem Docker-Container ausgeführt werden. Diese Eingabe muss auf den absoluten Pfad zu den Quelldateien auf dem Host zeigen. Beispiel: \"$(System.DefaultWorkingDirectory)/MyApp/\"",
12+
"loc.input.label.reportDirectory": "Berichtsverzeichnis",
13+
"loc.input.help.reportDirectory": "Der Pfad des Code Coverage-HTML-Berichtsverzeichnisses. Das Berichtsverzeichnis wird als Artefakt des Builds zum späteren Anzeigen veröffentlicht. Der Wert enthält unter Umständen Minimatch-Muster. Beispiel: \"$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura",
14+
"loc.input.label.additionalCodeCoverageFiles": "Weitere Dateien",
15+
"loc.input.help.additionalCodeCoverageFiles": "Dateipfadmuster, das zusätzliche Code Coverage-Dateien angibt, die als Artefakte des Builds veröffentlicht werden sollen. Der Wert enthält unter Umständen Minimatch-Muster. Beispiel: \"$(System.DefaultWorkingDirectory)/**/*.exec\"",
16+
"loc.input.label.failIfCoverageEmpty": "Fehler, wenn die Code Coverage-Ergebnisse fehlen",
17+
"loc.input.help.failIfCoverageEmpty": "Fehlschlagen der Aufgabe festlegen, wenn die Code Coverage keine Ergebnisse zum Veröffentlichen ergeben hat.",
18+
"loc.messages.FoundNMatchesForPattern": "%s Ergebnis(se) gefunden, die dem Muster: %s entsprechen",
19+
"loc.messages.MultipleSummaryFilesFound": "Mehrere Datei- oder Verzeichnisübereinstimmungen gefunden. Die erste Übereinstimmung wird verwendet: %s.",
20+
"loc.messages.NoCodeCoverage": "Keine Code Coverage-Ergebnisse zum Veröffentlichen gefunden.",
21+
"loc.messages.InstallDotNetCoreForHtmlReport": "Installieren Sie .NET Core, um das automatische Generieren von HTML-Berichten zu aktivieren.",
22+
"loc.messages.FailedToGenerateHtmlReport": "Fehler beim Generieren des HTML-Berichts. Fehler: %s",
23+
"loc.messages.IgnoringReportDirectory": "Das Code Coverage-Berichtsverzeichnis mit HTML-Inhalt wird ignoriert, weil HTML-Inhalte automatisch generiert werden.",
24+
"loc.messages.UpgradeAgentMessage": "Führen Sie ein Upgrade Ihrer Agent-Version durch. https://github.com/Microsoft/vsts-agent/releases",
25+
"loc.messages.GeneratedHtmlReport": "Generierter Code Coverage-HTML-Bericht: %s"
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"loc.friendlyName": "[To be deprecated] Publish code coverage",
3+
"loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=626485)",
4+
"loc.description": "[DEPRECATION WARNING! Users are recommended to switch to version 2*.] Publish Cobertura or JaCoCo code coverage results from a build",
5+
"loc.instanceNameFormat": "Publish code coverage from $(summaryFileLocation)",
6+
"loc.input.label.codeCoverageTool": "Code coverage tool",
7+
"loc.input.help.codeCoverageTool": "[DEPRECATION WARNING! Users are recommended to switch to task version 2*. For more details, see https://devblogs.microsoft.com/devops/new-pccr-task.] The tool with which code coverage results are generated.",
8+
"loc.input.label.summaryFileLocation": "Summary file",
9+
"loc.input.help.summaryFileLocation": "Path of the summary file containing code coverage statistics, such as line, method, and class coverage. The value may contain minimatch patterns. For example: `$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura/coverage.xml`",
10+
"loc.input.label.pathToSources": "Path to Source files",
11+
"loc.input.help.pathToSources": "Path to source files is required when coverage XML reports do not contain absolute path to source files. For e.g., JaCoCo reports do not use absolute paths and when publishing JaCoCo coverage for Java apps, the pattern would be similar to `$(System.DefaultWorkingDirectory)/MyApp/src/main/java/`.<br />This input is also needed if tests are run in a docker container. This input should point to absolute path to source files on the host. For e.g., `$(System.DefaultWorkingDirectory)/MyApp/`",
12+
"loc.input.label.reportDirectory": "Report directory",
13+
"loc.input.help.reportDirectory": "Path of the code coverage HTML report directory. The report directory is published for later viewing as an artifact of the build. The value may contain minimatch patterns. For example: `$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura`",
14+
"loc.input.label.additionalCodeCoverageFiles": "Additional files",
15+
"loc.input.help.additionalCodeCoverageFiles": "File path pattern specifying any additional code coverage files to be published as artifacts of the build. The value may contain minimatch patterns. For example: `$(System.DefaultWorkingDirectory)/**/*.exec`",
16+
"loc.input.label.failIfCoverageEmpty": "Fail when code coverage results are missing",
17+
"loc.input.help.failIfCoverageEmpty": "Fail the task if code coverage did not produce any results to publish.",
18+
"loc.messages.FoundNMatchesForPattern": "Found %s result(s) matching pattern: %s",
19+
"loc.messages.MultipleSummaryFilesFound": "Multiple file or directory matches were found. Using the first match: %s",
20+
"loc.messages.NoCodeCoverage": "No code coverage results were found to publish.",
21+
"loc.messages.InstallDotNetCoreForHtmlReport": "Please install dotnet core to enable automatic generation of Html report.",
22+
"loc.messages.FailedToGenerateHtmlReport": "Failed to generate Html report. Error: %s",
23+
"loc.messages.IgnoringReportDirectory": "Ignoring coverage report directory with Html content as we are auto-generating Html content",
24+
"loc.messages.UpgradeAgentMessage": "Please upgrade your agent version. https://github.com/Microsoft/vsts-agent/releases",
25+
"loc.messages.GeneratedHtmlReport": "Generated code coverage html report: %s",
26+
"loc.messages.V1TaskDeprecationNotice": "New V2 version of task publishing code coverage results is available to all our customers now. We highly recommend to stop using the V1 version and migrate to V2 version (https://learn.microsoft.com/azure/devops/pipelines/tasks/reference/publish-code-coverage-results-v2). For more details, see - https://devblogs.microsoft.com/devops/new-pccr-task."
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"loc.friendlyName": "Publicar resultados de cobertura de código",
3+
"loc.helpMarkDown": "[Obtener más información acerca de esta tarea](https://go.microsoft.com/fwlink/?LinkID=626485)",
4+
"loc.description": "Publicar los resultados de cobertura de código de Cobertura o JaCoCo de una compilación",
5+
"loc.instanceNameFormat": "Publicar cobertura de código de $(summaryFileLocation)",
6+
"loc.input.label.codeCoverageTool": "Herramienta de cobertura de código",
7+
"loc.input.help.codeCoverageTool": "Herramienta con la que se generan los resultados de cobertura de código.",
8+
"loc.input.label.summaryFileLocation": "Archivo de resumen",
9+
"loc.input.help.summaryFileLocation": "Ruta de acceso del archivo de resumen que contiene estadísticas de cobertura de código, como línea, método y cobertura de clase. El valor puede contener patrones minimatch. Por ejemplo: \"$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura/coverage.xml\"",
10+
"loc.input.label.pathToSources": "Ruta de acceso a los archivos de origen",
11+
"loc.input.help.pathToSources": "Se requiere la ruta de acceso a los archivos de código fuente cuando los informes XML de cobertura no contienen la ruta de acceso absoluta a dichos archivos. Por ejemplo, los informes de JaCoCo no usan rutas de acceso absolutas y, al publicar la cobertura de JaCoCo para las aplicaciones Java, el patrón sería similar a \"$(System.DefaultWorkingDirectory)/MyApp/src/main/java/\". <br />También se necesita esta entrada si las pruebas se ejecutan en un contenedor Docker. La entrada debe apuntar a una ruta de acceso absoluta a los archivos de código fuente en el host. Por ejemplo, \"$(System.DefaultWorkingDirectory)/MyApp/\".",
12+
"loc.input.label.reportDirectory": "Directorio de informes",
13+
"loc.input.help.reportDirectory": "Ruta de acceso del directorio de informes HTML de cobertura de código. El directorio de informes se publica para verlo después como artefacto de la compilación. El valor puede contener patrones minimatch. Por ejemplo: \"$(System.DefaultWorkingDirectory)/MyApp/**/site/cobertura\"",
14+
"loc.input.label.additionalCodeCoverageFiles": "Archivos adicionales",
15+
"loc.input.help.additionalCodeCoverageFiles": "Patrón de ruta de acceso de archivo que especifica archivos de cobertura de código adicionales que deben publicarse como artefactos de la compilación. El valor puede contener patrones minimatch. Por ejemplo: \"$(System.DefaultWorkingDirectory)/**/*.exec\"",
16+
"loc.input.label.failIfCoverageEmpty": "Error si faltan los resultados de cobertura de código",
17+
"loc.input.help.failIfCoverageEmpty": "Error de tarea si la cobertura de código no produjo resultados para publicar.",
18+
"loc.messages.FoundNMatchesForPattern": "Se encontraron %s resultados coincidentes con el patrón: %s",
19+
"loc.messages.MultipleSummaryFilesFound": "Se encontraron varios archivos o directorios coincidentes. Se usará la primera coincidencia: %s",
20+
"loc.messages.NoCodeCoverage": "No se encontraron resultados de cobertura de código para publicar.",
21+
"loc.messages.InstallDotNetCoreForHtmlReport": "Instale dotnet core para habilitar la generación automática de informes HTML.",
22+
"loc.messages.FailedToGenerateHtmlReport": "No se pudo generar el informe HTML. Error: %s",
23+
"loc.messages.IgnoringReportDirectory": "Se ignora el directorio de informes de cobertura con contenido HTML, ya que se genera contenido HTML automáticamente",
24+
"loc.messages.UpgradeAgentMessage": "Actualice la versión del agente. https://github.com/Microsoft/vsts-agent/releases",
25+
"loc.messages.GeneratedHtmlReport": "Informe HTML de cobertura de código generado: %s"
26+
}

0 commit comments

Comments
 (0)