From f2adc093d1e39a6ca93ac505d76e45bef149504d Mon Sep 17 00:00:00 2001 From: Katherine Kampf Date: Mon, 27 Sep 2021 13:06:44 -0700 Subject: [PATCH 1/2] GA Starter Course (#21738) Co-authored-by: Melanie Yarbrough <11952755+myarb@users.noreply.github.com> --- .../use-the-git-and-github-starter-assignment.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/use-the-git-and-github-starter-assignment.md b/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/use-the-git-and-github-starter-assignment.md index 378b576eda..a4ee079ccb 100644 --- a/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/use-the-git-and-github-starter-assignment.md +++ b/content/education/manage-coursework-with-github-classroom/teach-with-github-classroom/use-the-git-and-github-starter-assignment.md @@ -8,12 +8,6 @@ redirect_from: shortTitle: Starter assignment --- -{% note %} - -**Note:** The Git & {% data variables.product.company_short %} starter assignment is in beta and subject to change. - -{% endnote %} - The Git & {% data variables.product.company_short %} starter assignment is a pre-made course that summarizes the basics of Git and {% data variables.product.company_short %} and links students to resources to learn more about specific topics. ## Prerequisites From deab27360c04b4c39d0cef36af228c6db6e84ffb Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Mon, 27 Sep 2021 15:17:05 -0500 Subject: [PATCH 2/2] Announce if Heroku appears to be down (#21762) --- .github/workflows/prod-build-deploy.yml | 15 +++++++++++---- .github/workflows/staging-deploy-pr.yml | 15 +++++++++++---- script/deployment/create-app.js | 12 +++++++++++- script/deployment/deploy-to-production.js | 12 ++++++++++++ script/deployment/deploy-to-staging.js | 18 ++++++++++++++++++ script/deployment/undeploy-from-staging.js | 8 ++++++++ 6 files changed, 71 insertions(+), 9 deletions(-) diff --git a/.github/workflows/prod-build-deploy.yml b/.github/workflows/prod-build-deploy.yml index 5c4c9d001b..fea0e90af3 100644 --- a/.github/workflows/prod-build-deploy.yml +++ b/.github/workflows/prod-build-deploy.yml @@ -101,11 +101,18 @@ jobs: const Heroku = require('heroku-client') const heroku = new Heroku({ token: process.env.HEROKU_API_TOKEN }) - const { source_blob: sourceBlob } = await heroku.post('/sources') - const { put_url: uploadUrl, get_url: downloadUrl } = sourceBlob + try { + const { source_blob: sourceBlob } = await heroku.post('/sources') + const { put_url: uploadUrl, get_url: downloadUrl } = sourceBlob - core.setOutput('upload_url', uploadUrl) - core.setOutput('download_url', downloadUrl) + core.setOutput('upload_url', uploadUrl) + core.setOutput('download_url', downloadUrl) + } catch (error) { + if (error.statusCode === 503) { + console.error('💀 Heroku may be down! Please check its Status page: https://status.heroku.com/') + } + throw error + } # See: https://devcenter.heroku.com/articles/build-and-release-using-the-api#sources-endpoint - name: Upload to the Heroku build source diff --git a/.github/workflows/staging-deploy-pr.yml b/.github/workflows/staging-deploy-pr.yml index f449480549..5879902ae3 100644 --- a/.github/workflows/staging-deploy-pr.yml +++ b/.github/workflows/staging-deploy-pr.yml @@ -217,11 +217,18 @@ jobs: const Heroku = require('heroku-client') const heroku = new Heroku({ token: process.env.HEROKU_API_TOKEN }) - const { source_blob: sourceBlob } = await heroku.post('/sources') - const { put_url: uploadUrl, get_url: downloadUrl } = sourceBlob + try { + const { source_blob: sourceBlob } = await heroku.post('/sources') + const { put_url: uploadUrl, get_url: downloadUrl } = sourceBlob - core.setOutput('upload_url', uploadUrl) - core.setOutput('download_url', downloadUrl) + core.setOutput('upload_url', uploadUrl) + core.setOutput('download_url', downloadUrl) + } catch (error) { + if (error.statusCode === 503) { + console.error('💀 Heroku may be down! Please check its Status page: https://status.heroku.com/') + } + throw error + } # See: https://devcenter.heroku.com/articles/build-and-release-using-the-api#sources-endpoint - name: Upload to the Heroku build source diff --git a/script/deployment/create-app.js b/script/deployment/create-app.js index ce5fc7bef0..6d60058394 100644 --- a/script/deployment/create-app.js +++ b/script/deployment/create-app.js @@ -38,7 +38,8 @@ export default async function createApp(pullRequest) { try { await heroku.get(`/apps/${appName}`) - } catch (e) { + } catch (error) { + announceIfHerokuIsDown(error) appExists = false } @@ -52,6 +53,7 @@ export default async function createApp(pullRequest) { console.log('Heroku App created', newApp) } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to create Heroku App ${appName}. Error: ${error}`) } @@ -68,6 +70,7 @@ export default async function createApp(pullRequest) { console.log(`Added PR author @${author.login} as a Heroku app collaborator`) } } catch (error) { + announceIfHerokuIsDown(error) // It's fine if this fails, it shouldn't block the app from deploying! console.warn(`Warning: failed to add PR author as a Heroku app collaborator. Error: ${error}`) } @@ -82,8 +85,15 @@ export default async function createApp(pullRequest) { body: appConfigVars, }) } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to update Heroku app configuration variables. Error: ${error}`) } return appName } + +function announceIfHerokuIsDown(error) { + if (error && error.statusCode === 503) { + console.error('💀 Heroku may be down! Please check its Status page: https://status.heroku.com/') + } +} diff --git a/script/deployment/deploy-to-production.js b/script/deployment/deploy-to-production.js index e3c3309664..5ccc4f4ca5 100755 --- a/script/deployment/deploy-to-production.js +++ b/script/deployment/deploy-to-production.js @@ -143,6 +143,7 @@ export default async function deployToProduction({ body: appConfigVars, }) } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to update Heroku app configuration variables. Error: ${error}`) } @@ -158,6 +159,7 @@ export default async function deployToProduction({ }, }) } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to create Heroku build. Error: ${error}`) } @@ -183,6 +185,7 @@ export default async function deployToProduction({ continue } } + announceIfHerokuIsDown(error) throw new Error(`Failed to get build status. Error: ${error}`) } @@ -235,6 +238,7 @@ export default async function deployToProduction({ continue } } + announceIfHerokuIsDown(error) throw new Error(`Failed to get release status. Error: ${error}`) } @@ -293,6 +297,7 @@ export default async function deployToProduction({ continue } } + announceIfHerokuIsDown(error) throw new Error(`Failed to find dynos for this release. Error: ${error}`) } } @@ -323,6 +328,7 @@ export default async function deployToProduction({ `Here are the last ${HEROKU_LOG_LINES_TO_SHOW} lines of the Heroku log:\n\n${logText}` ) } catch (error) { + announceIfHerokuIsDown(error) // Don't fail because of this error console.error(`Failed to retrieve the Heroku logs for the crashed dynos. Error: ${error}`) } @@ -429,3 +435,9 @@ async function getTarballUrl({ octokit, owner, repo, sha }) { }) return tarballUrl } + +function announceIfHerokuIsDown(error) { + if (error && error.statusCode === 503) { + console.error('💀 Heroku may be down! Please check its Status page: https://status.heroku.com/') + } +} diff --git a/script/deployment/deploy-to-staging.js b/script/deployment/deploy-to-staging.js index 1cb4c12268..8047ec46dc 100644 --- a/script/deployment/deploy-to-staging.js +++ b/script/deployment/deploy-to-staging.js @@ -137,6 +137,7 @@ export default async function deployToStaging({ try { await heroku.get(`/apps/${appName}`) } catch (error) { + announceIfHerokuIsDown(error) appExists = false } @@ -150,6 +151,7 @@ export default async function deployToStaging({ console.log(`Heroku app '${appName}' deleted for forced rebuild`) } catch (error) { + announceIfHerokuIsDown(error) throw new Error( `Failed to delete Heroku app '${appName}' for forced rebuild. Error: ${error}` ) @@ -201,6 +203,7 @@ export default async function deployToStaging({ // This probably will not be available yet build = appSetup.build } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to create Heroku app '${appName}'. Error: ${error}`) } @@ -217,6 +220,7 @@ export default async function deployToStaging({ console.log(`Added PR author @${author.login} as a Heroku app collaborator`) } } catch (error) { + announceIfHerokuIsDown(error) // It's fine if this fails, it shouldn't block the app from deploying! console.warn( `Warning: failed to add PR author as a Heroku app collaborator. Error: ${error}` @@ -239,6 +243,7 @@ export default async function deployToStaging({ continue } } + announceIfHerokuIsDown(error) throw new Error(`Failed to get AppSetup status. Error: ${error}`) } @@ -278,6 +283,7 @@ See Heroku logs for more information:\n${logUrl}` body: appConfigVars, }) } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to update Heroku app configuration variables. Error: ${error}`) } @@ -293,6 +299,7 @@ See Heroku logs for more information:\n${logUrl}` }, }) } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to create Heroku build. Error: ${error}`) } @@ -319,6 +326,7 @@ See Heroku logs for more information:\n${logUrl}` continue } } + announceIfHerokuIsDown(error) throw new Error(`Failed to get build status. Error: ${error}`) } @@ -371,6 +379,7 @@ See Heroku logs for more information:\n${logUrl}` continue } } + announceIfHerokuIsDown(error) throw new Error(`Failed to get release status. Error: ${error}`) } @@ -437,6 +446,7 @@ See Heroku logs for more information:\n${logUrl}` try { nextRelease = await heroku.get(`/apps/${appName}/releases/${release.version + 1}`) } catch (error) { + announceIfHerokuIsDown(error) throw new Error( `Could not find a secondary release to explain the disappearing dynos. Error: ${error}` ) @@ -475,6 +485,7 @@ See Heroku logs for more information:\n${logUrl}` continue } } + announceIfHerokuIsDown(error) throw new Error(`Failed to find dynos for this release. Error: ${error}`) } } @@ -505,6 +516,7 @@ See Heroku logs for more information:\n${logUrl}` `Here are the last ${HEROKU_LOG_LINES_TO_SHOW} lines of the Heroku log:\n\n${logText}` ) } catch (error) { + announceIfHerokuIsDown(error) // Don't fail because of this error console.error(`Failed to retrieve the Heroku logs for the crashed dynos. Error: ${error}`) } @@ -632,3 +644,9 @@ async function getTarballUrl({ octokit, owner, repo, sha }) { }) return tarballUrl } + +function announceIfHerokuIsDown(error) { + if (error && error.statusCode === 503) { + console.error('💀 Heroku may be down! Please check its Status page: https://status.heroku.com/') + } +} diff --git a/script/deployment/undeploy-from-staging.js b/script/deployment/undeploy-from-staging.js index 184167bea8..8950e5a5e1 100644 --- a/script/deployment/undeploy-from-staging.js +++ b/script/deployment/undeploy-from-staging.js @@ -42,6 +42,7 @@ export default async function undeployFromStaging({ try { await heroku.get(`/apps/${appName}`) } catch (error) { + announceIfHerokuIsDown(error) appExists = false } @@ -52,6 +53,7 @@ export default async function undeployFromStaging({ console.log(`Heroku app '${appName}' deleted`) } catch (error) { + announceIfHerokuIsDown(error) throw new Error(`Failed to delete Heroku app '${appName}'. Error: ${error}`) } } @@ -127,3 +129,9 @@ export default async function undeployFromStaging({ throw error } } + +function announceIfHerokuIsDown(error) { + if (error && error.statusCode === 503) { + console.error('💀 Heroku may be down! Please check its Status page: https://status.heroku.com/') + } +}