From c55cc089ef004cfbbb95f6411d334633471efad7 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Fri, 19 Apr 2019 12:53:10 -0400 Subject: [PATCH] put platform and arch into commit message status object --- scripts/binary/bump.coffee | 13 ++++++++++++- scripts/test-other-projects.js | 7 ++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/binary/bump.coffee b/scripts/binary/bump.coffee index 1526a042ec..b2cbd1b95e 100644 --- a/scripts/binary/bump.coffee +++ b/scripts/binary/bump.coffee @@ -176,7 +176,6 @@ module.exports = { # the test projects will exercise the new version of # the Cypress test runner we just built runTestProjects: (getStatusAndMessage, providerName, version) -> - # status is {owner, repo, sha} projectFilter = getFilterByProvider(providerName) @@ -217,6 +216,18 @@ module.exports = { createGithubCommitStatusCheck = ({ sha }) -> return if not status + # status is {owner, repo, sha} and maybe a few other properties + isStatus = check.schema({ + owner: check.unemptyString, + repo: check.unemptyString, + sha: check.commitId, + context: check.unemptyString, + platform: check.unemptyString, + arch: check.unemptyString + }) + if not isStatus(status) + console.error("Invalid status object %o", status) + targetUrl = "https://github.com/#{owner}/#{repo}/commit/#{sha}" commitStatusOptions = { targetUrl, diff --git a/scripts/test-other-projects.js b/scripts/test-other-projects.js index 9313318124..3a4ddfa7dc 100644 --- a/scripts/test-other-projects.js +++ b/scripts/test-other-projects.js @@ -98,11 +98,16 @@ const getStatusAndMessage = (projectRepoName) => { if (commit && is.commitId(commit)) { // commit is full 40 character hex string + const platform = os.platform() + const arch = os.arch() + status = { owner: 'cypress-io', repo: 'cypress', sha: commit, - context: `[${os.platform()}-${os.arch()}] ${projectRepoName}`, + platform, + arch, + context: `[${platform}-${arch}] ${projectRepoName}`, } }