-
Notifications
You must be signed in to change notification settings - Fork 17
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
[code-infra] Fix deploy #212
Changes from all commits
cca362e
235599a
773b40c
e7b298d
044c9bc
c6a9327
ef83cf5
0e52db9
cfeca4c
1ca630f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.cache | ||
/.git | ||
/contributor-dashboard-legacy/ | ||
/tools-public/toolpad/.generated/ | ||
/tools-public/toolpad/**/*.yml | ||
build | ||
node_modules | ||
pnpm-lock.yaml | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,11 @@ module.exports = { | |
}, | ||
overrides: [ | ||
...baseline.overrides, | ||
{ | ||
files: ['contributor-dashboard-legacy/**'], | ||
rules: { | ||
'import/no-unresolved': 'off', // TODO, to fix at one point | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is because we are not using the pnpm workspace for contributor-dashboard-legacy. One thing that I didn't try is to simply add |
||
}, | ||
}, | ||
], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,14 @@ | |
|
||
# dependencies | ||
node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/.env | ||
/.eslintcache | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
src | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was crazy. |
||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
|
@@ -33,27 +28,14 @@ yarn-error.log* | |
.netlify | ||
|
||
# local env files | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# docs | ||
|
||
/docs/export | ||
|
||
lerna-debug.log | ||
|
||
.env | ||
|
||
dist/ | ||
|
||
packages/toolpad-app/public/web_modules | ||
packages/toolpad-app/public/runtime | ||
packages/toolpad-app/public/reactDevtools | ||
packages/toolpad-app/public/runtime | ||
packages/toolpad-app/public/typings.json | ||
packages/toolpad-app/prisma/generated | ||
|
||
|
||
.toolpad-generated |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
/tools-public/toolpad/**/*.yml | ||
/tools-public/toolpad/.generated/ | ||
Comment on lines
-1
to
-2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Match mui-private |
||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
async function fetchCircleCIApiV2(endpoint) { | ||
const url = `https://circleci.com/api/v2/${endpoint}`; | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(url); | ||
const response = await fetch(url); | ||
const json = await response.json(); | ||
return json; | ||
} | ||
|
||
/** | ||
* netlify function that wraps CircleCI API v2 which requires authentification. | ||
* | ||
* @param {*} event | ||
* @param {*} context | ||
*/ | ||
exports.handler = async function circleCIArtefact(event) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bypass CORS after CircleCI API change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I understand correctly that to fill the table we're fetching from multiple functions and reconcile them client-side? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔 Actually, we're already calculating the diff in the dangerfile. Would probably make more sense to just calculate the diff in CI, store it on file and push it to S3 and make it public. Then danger can just read the file and the UI/toolpad can fetch from S3. We wouldn't have to fetch and calculate in 3 places and we wouldn't have the problem with disappearing expired build artifacts neither. Not for this PR though. |
||
const { queryStringParameters } = event; | ||
|
||
const buildNumberParameter = queryStringParameters.buildNumber; | ||
const buildNumber = parseInt(buildNumberParameter, 10); | ||
if (Number.isNaN(buildNumber)) { | ||
return { | ||
statusCode: 500, | ||
body: JSON.stringify( | ||
`Given query param buildNumber is not a number. Received '${buildNumberParameter}'.`, | ||
), | ||
}; | ||
} | ||
// eslint-disable-next-line no-console | ||
console.log(`fetching details for job #${buildNumber}`); | ||
|
||
const artifacts = await fetchCircleCIApiV2( | ||
`project/github/mui/material-ui/${buildNumber}/artifacts`, | ||
); | ||
const response = { | ||
statusCode: 200, | ||
body: JSON.stringify(artifacts), | ||
}; | ||
|
||
return response; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
[build] | ||
functions = "functions" | ||
base = "contributor-dashboard-legacy" | ||
|
||
# Directory (relative to root of your repo) that contains the deploy-ready | ||
# HTML files and assets generated by the build. If a base directory has | ||
# been specified, include it in the publish directory path. | ||
publish = "build" | ||
|
||
# Default build command. | ||
command = "pnpm build" | ||
|
||
[build.environment] | ||
NODE_VERSION = "18" | ||
PNPM_FLAGS = "--ignore-workspace" | ||
|
||
[functions] | ||
directory = "functions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get to lint this a bit more.