You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8cd8f57
Browse filesBrowse the repository at this point in the historyBrowse files
Say what is wrong with a pull request number, and test the head ref (#307) (#327)
Asking the job for 16360 spent minutes cloning and resetting the
OpenModelica repository before failing with "Could not fetch
refs/pull/16360/merge: either there is no such pull request, or GitHub
cannot merge it into its base branch". Both of those were wrong about what
had happened: 16360 is an *issue*. Issues and pull requests share one
numbering on GitHub, so an issue number reaches the job looking exactly
like a pull request number, and the answer to that is "there is no such
pull request", which the message buried as one of two possibilities.
The stage now asks GitHub what the number is - one git ls-remote, before
the clone, the reset and the build - and says so:
OpenModelica/OpenModelica has no pull request 16360. Issues and pull
requests share one numbering there, so check that 16360 is not the
number of an issue.
The checkout separates the two cases as well. GitHub only has
refs/pull/<N>/merge while it can merge the pull request into its base
branch, so a pull request that conflicts, or one already closed, has only
refs/pull/<N>/head. That is still something to test - the pull request on
its own rather than as it would land - so it is used, with a warning
saying which of the two was tested and what the head ref does not have.
Nothing at all for that number is still an error.
While here: a parameter is only recorded on a job once a build has run
with its definition, so the build that first sees this file has the new
ones as null, and every stage that reads them to decide whether to run
would fail on it, not only a pull request one. They now fall back to what
the definition says the default is.
---
Generated by Claude Code.
error "pull_request is a pull request number; got '${params.pull_request}'"
140
140
}
141
141
}
142
+
// Before the clone, the reset and the build: a number that is not a
143
+
// pull request costs minutes to find out about otherwise. Issues and
144
+
// pull requests share one numbering, so an issue number gets this far.
145
+
sh """
146
+
if ! git ls-remote --exit-code https://github.com/OpenModelica/OpenModelica.git 'refs/pull/${pullRequest()}/*' > /dev/null; then
147
+
echo "OpenModelica/OpenModelica has no pull request ${pullRequest()}. Issues and pull requests share one numbering there, so check that ${pullRequest()} is not the number of an issue."
148
+
exit 1
149
+
fi
150
+
"""
142
151
// One build of omc per pull request is kept, as for a branch, and they
143
152
// accumulate: a pull request is tested once and never again.
144
153
sh 'find "$HOME/saved_omc" -maxdepth 1 -name "pr-*" -type d -mtime +14 -exec rm -rf {} ";" || true'
0 commit comments