Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg-ci] Add AZP logging markup for skipped ports #19259

Closed
wants to merge 6 commits into from

Conversation

dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Jul 30, 2021

  • What does your PR fix?

    Occassionally, skipped builds (in particular "cascade") for changed ports went unnoticed.
    Based on changed ports and versions files in git, this change adds AZP error messages (but not job failures) for skipped ports, making them more visible in Github.

  • Which triplets are supported/not supported? Have you updated the CI baseline?

    all, not needed

  • Does your PR follow the maintainer guide?

    yes

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    not needed

@dg0yt

This comment has been minimized.

@dg0yt
Copy link
Contributor Author

dg0yt commented Aug 1, 2021

Works now as intented, but includes a POC commit which must be removed before merge.

@dg0yt dg0yt marked this pull request as ready for review August 1, 2021 14:03
@PhoebeHui PhoebeHui added category:infrastructure Pertaining to the CI/Testing infrastrucutre requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. labels Aug 2, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6bc4362fb49e53f1fff7f51e4e27e1946755ecc6 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 94f34ac..02a5321 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -5530,7 +5530,7 @@
     },
     "raylib": {
       "baseline": "3.7.0",
-      "port-version": 1
+      "port-version": 2
     },
     "rbdl": {
       "baseline": "2.6.0",
diff --git a/versions/r-/raylib.json b/versions/r-/raylib.json
index 493c251..70bc6a8 100644
--- a/versions/r-/raylib.json
+++ b/versions/r-/raylib.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "a6e75fbb346a36aecf774e698ac01e7d9122632b",
+      "version-semver": "3.7.0",
+      "port-version": 2
+    },
     {
       "git-tree": "e27352fbab2a4e815a478265032a4faa60d34060",
       "version-semver": "3.7.0",

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 6bc4362fb49e53f1fff7f51e4e27e1946755ecc6 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 94f34ac..02a5321 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -5530,7 +5530,7 @@
     },
     "raylib": {
       "baseline": "3.7.0",
-      "port-version": 1
+      "port-version": 2
     },
     "rbdl": {
       "baseline": "2.6.0",
diff --git a/versions/r-/raylib.json b/versions/r-/raylib.json
index 493c251..7f97573 100644
--- a/versions/r-/raylib.json
+++ b/versions/r-/raylib.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "8ea2085bf2813963d5e4a881b09dab3017bf92b3",
+      "version-semver": "3.7.0",
+      "port-version": 2
+    },
     {
       "git-tree": "e27352fbab2a4e815a478265032a4faa60d34060",
       "version-semver": "3.7.0",

@dg0yt
Copy link
Contributor Author

dg0yt commented Aug 15, 2021

This now also covers skipped ports which depend on changed ports.

It should be reviewed and (after removal of the POC commits) merged for the benefit of all contributors.

@PhoebeHui
Copy link
Contributor

@dg0yt, I will ask other members to review this PR! Sorry for the delay!

@dg0yt
Copy link
Contributor Author

dg0yt commented Sep 5, 2021

Ping for hints how to move this forward.

@PhoebeHui
Copy link
Contributor

@ras0219 @ras0219-msft @BillyONeal, could you please take a look again?

$changedPorts | ForEach-Object {
if ($skippedPorts -contains $_) {
$port = $_
Write-Host "##vso[task.logissue type=error]$port`: build skipped, reason: CI baseline file."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Write-Host "##vso[task.logissue type=error]$port`: build skipped, reason: CI baseline file."
Write-Host "##vso[task.logissue type=error]$port`: skipped by ci.baseline.txt."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to use the file name here so that contributors can find it more easily.


$current_port_and_features = ':'
& "./vcpkg$executableExtension" ci $Triplet --x-xunit=$xmlFile --exclude=$skipList --failure-logs=$failureLogs @hostArgs @commonArgs `
| ForEach-Object {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other reviewers: I expected this to hang the run until all the output was collected but it didn't seem to do that in testing.

| ForEach-Object {
$_
if ($LogSkippedPorts) {
if ($_ -match '^ *([^ :]+):[^:]*: *cascade:' -and $changedPorts -contains $Matches[1]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little concerned about making this "output intended for human consumption" load bearing in this way. Not an over my dead body issue but a better solution would be to have the tool do this processing and report it in the output so that changes in the tool don't cause silent failure of the infrastructure.

That said, while that is a solution I prefer, this solution is better than the status quo and such failure would only degrade things to the status quo, so I would not block merging over that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($_ -match '^ *([^ :]+):[^:]*: *cascade:' -and $changedPorts -contains $Matches[1]) {
# Parse the ports ABI hash list at the start of output looking for ports vcpkg ci wants to build
# (denoted by *) which are marked "cascade" because one of their dependencies were in
# ci.baseline.txt.
if ($_ -match '^ *([^ :]+):[^:]*: *cascade:' -and $changedPorts -contains $Matches[1]) {

if ($LogSkippedPorts) {
if ($_ -match '^ *([^ :]+):[^:]*: *cascade:' -and $changedPorts -contains $Matches[1]) {
$port = $Matches[1]
Write-Host "##vso[task.logissue type=error]$port`: build skipped, reason: cascade from CI baseline file."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Write-Host "##vso[task.logissue type=error]$port`: build skipped, reason: cascade from CI baseline file."
Write-Host "##vso[task.logissue type=error]$port`: build skipped because a dependency is skipped in ci.baseline.txt."

if ($_ -match '^([^:[]+)[:[]' -and $changedPorts -contains $Matches[1]) {
$port = $Matches[1]
if ($current_port_and_features -notmatch "^$port[:[]") {
Write-Host "##vso[task.logissue type=error]$port`: build of depending port '$current_port_and_features' skipped due to missing dependencies."
Copy link
Member

@BillyONeal BillyONeal Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One reason it might be a good idea to move this into the tool is that it would be easier to describe which dependency failed.

Copy link
Member

@BillyONeal BillyONeal Sep 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't duplicate the port name in my suggested edit; I'm on the fence about whether we should avoid the duplication or not.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, I had this backwards. It isn't a repeated port name, the actual output is something like:

freexl: build of depending port 'libspatialite[core]:x86-windows' skipped due to missing dependencies.

as in, "freexl failed, and that made libspatialite cascade"

How about:

Write-Host "##vso[task.logissue type=error]$port`: build failure caused '$current_port_and_features' skip due to missing dependencies."

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we cannot be sure that a freexl build failure causes libspatialite[core]:x86-windows to be skipped. All we know is that:

  • freexl is direct or transitive dependency of libspatialite[core]:x86-windows.
  • one of the dependencies of libspatialite[core]:x86-windows failed to build.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Write-Host "##vso[task.logissue type=error]$current_port_and_features`: not attempted because '$port' is unavailable."

@BillyONeal
Copy link
Member

I poked other maintainers to point out that despite this P/R being "failing" that is intentional right now to demonstrate output.

$current_port_and_features = $Matches[1]
}
elseif ($_ -match 'failed with: CASCADED_DUE_TO_MISSING_DEPENDENCIES') {
& "./vcpkg$executableExtension" depend-info $current_port_and_features | ForEach-Object {
Copy link
Contributor

@ras0219-msft ras0219-msft Sep 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should save these and process them at the end of the build -- otherwise this is performing concurrent vcpkg calls which is a big no-no.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively: this might be appropriate to add to the original ci command

@@ -1,3 +1,5 @@
message(FATAL_ERROR "Simulate failure")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may misunderstand the purpose of this machinery, but I think the failures this is intended to capture are when something is moving to skip -- i.e. when the supports field or the ci.baseline.txt is modified. If a port fails to build, we'll already see that error as part of the main CI output. It's the reaction to that (add to ci.baseline.txt or change supports) that causes these "invisible" failures.

Therefore, I think it would be a better test of this machinery would be to change freexl's supports clause.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case which I wanted to cover here is not obious in the proof-of-concept change:

  • Independent port A is modified by a PR.
  • Independent port B fails for some other reason.
  • Port C which depends on A and B is skipped because of B failing.
    @BillyONeal That's why the output pattern is:
    A: build of depending port 'C' skipped due to missing dependencies."
    -- I'm looking at C, I know that it depends on A, and I know that A was modified.

(In the proof of concept, A = B.)
I admit that this might generate a lot of output if A and B are frequently used ports, in particular if A = B.

Now I could also collect failed ports, and thus identify that B caused C to be skipped.

In addition, it might be possible to directly mark B as "unrelated" error if not modified and not depending on a modified port. However, this doesn't work when modifying maintainer functions in scripts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our policy is that we do not generally merge PRs with B failing -- we will wait for another PR to fix B or fix B in this PR. Given that policy, what does this additional check catch?

(In exceptional circumstances we do merge PRs with a port failing, but in those cases we perform additional manual review to ensure that we aren't in the A+B=C case you've outlined)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our policy is that we do not generally merge PRs with B failing -- we will wait for another PR to fix B or fix B in this PR. Given that policy, what does this additional check catch?

Okay.

With regard to independent ports, the information which would be immediately helpful instead is whether a failing port is unrelated to modified ports. This would reduce workload for contributors and reviewers.
Examples: #20136 (comment)
However, this information would be needed next to the existing message:

##[error]REGRESSION: python3:x64-osx. If expected, add python3:x64-osx=fail to .\scripts\ci.baseline.txt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "unrelated ports" are now better resolved by microsoft/vcpkg-tool#210.

@JackBoosY JackBoosY removed the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Sep 30, 2021
@dg0yt dg0yt marked this pull request as draft October 25, 2021 06:28
@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 25, 2022

I won't continue this PR. The changes for AZP test result upload (via vcpkg ci xUnit output) should hopefully help to improve transparency about tests which are "not executed".

@dg0yt dg0yt closed this Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:infrastructure Pertaining to the CI/Testing infrastrucutre
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants