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

fix: Do not fallback to all on small workflow changes #4371

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/scripts/detect-jobs-to-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ async function detectJobsTorun({ filesChanged, GITHUB_REF }) {
}

console.debug({ jobsToRun })

// remove github workflow files if they only change things in a job that will be run
/*

get content or line numbers of changed files
focus on ones we did not "handle" above yet
see in which "block" the changed lines are
eliminate all the lines that are in blocks that we already handled
*/

// do we have a mismatch?
console.debug('filesChanged.length', filesChanged.length)
console.debug({ totalNumberOfFilesChangedInsideDirectories })

Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/scripts/detect-jobs-to-run.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ Array [
expect(jobsToRun.includes('community-generators')).toBe(true)
})

it.only('files changed inside platform folder and github actions workflow', async () => {
const filesChanged = ['platforms/somefile.js', '.github/workflows/test.yaml']
const jobsToRun = await detectJobsTorun({ filesChanged })

expect(jobsToRun).toMatchInlineSnapshot(`
Array [
"platforms",
]
`
)
expect(jobsToRun.includes('platforms')).toBe(true)
expect(jobsToRun.includes('platforms-serverless')).toBe(false)
})

it('should fallback: no change', async () => {
const filesChanged = []
const jobsToRun = await detectJobsTorun({ filesChanged })
Expand Down
2 changes: 1 addition & 1 deletion bundlers/webpack-browser-custom-output/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "webpack",
"name": "webpack-browser-custom-output",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "prisma-dbml-generator",
"name": "prisma-json-schema-generator",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion core-features/browser-build/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "next-test",
"name": "browser-build",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-and-cli-install-via-global-cli",
"name": "generate-client-and-cli-install-via-global-cli-no-lockfile-npm",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-and-cli-install-via-global-cli",
"name": "generate-client-and-cli-install-via-global-cli-npm-lockfile",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-and-cli-install-via-global-cli",
"name": "generate-client-and-cli-install-via-global-cli-pnpm-lockfile",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-and-cli-install-via-global-cli",
"name": "generate-client-and-cli-install-via-global-cli-yarn-lockfile",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion core-features/generate-client-install-npm/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-install",
"name": "generate-client-install-npm",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-install-on-sub-project",
"name": "generate-client-install-on-sub-project-npm",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-install-on-sub-project",
"name": "generate-client-install-on-sub-project-pnpm",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-install-on-sub-project",
"name": "generate-client-install-on-sub-project-yarn",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion core-features/generate-client-install-pnpm/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-install",
"name": "generate-client-install-pnpm",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion core-features/generate-client-install-yarn/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "generate-client-install",
"name": "generate-client-install-yarn",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion databases-macos/sqlserver-azure-sql/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "sqlserver-azure-sql",
"name": "macos-sqlserver-azure-sql",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion dataproxy/vercel-cli-serverless-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vercel-cli",
"name": "vercel-cli-serverless-functions",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion driver-adapters-wasm/pg-node-basic-esm/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pg-node-basic-esm",
"name": "wasm-pg-node-basic-esm",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion driver-adapters-wasm/pg-node-basic/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pg-node-basic",
"name": "wasm-pg-node-basic",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "next-test",
"name": "nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion generic/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "basic",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion packagers/npm-global/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "npm-global",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion packagers/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "npm",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion packagers/pnpm-workspaces-custom-output/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "pnpm-workspaces-custom-output",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion packagers/pnpm-workspaces-default-output/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "pnpm-workspaces-default-output",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion packagers/pnpm/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "pnpm",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion packagers/yarn/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "yarn",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion packagers/yarn3-without-pnp/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "yarn3-without-pnp",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
2 changes: 1 addition & 1 deletion platforms-serverless/azure-functions-linux/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "azure-functions-linux",
"license": "MIT",
"scripts": {},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "azure-functions-windows",
"license": "MIT",
"scripts": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion platforms-serverless/gcp-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "gcp-functions",
"license": "MIT",
"scripts": {
"gcp-build": "CI=1 && PRISMA_TELEMETRY_INFORMATION='ecosystem-tests platforms/gcp-functions postinstall' && npx prisma generate"
Expand Down
2 changes: 1 addition & 1 deletion platforms-serverless/lambda-node-16/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lambda",
"name": "lambda-node-16",
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion platforms-serverless/lambda-node-20/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "lambda",
"name": "lambda-node-20",
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion platforms/m1-macstadium/code/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "m1-macstadium",
"name": "m1-macstadium-code",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion process-managers/pm2/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "script",
"name": "pm2",
"license": "MIT",
"devDependencies": {
"@types/node": "16.18.68",
Expand Down
Loading