-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: cd test app * fix: rename app * fix: name * fix: added dummy queries and codegen target * fix: eslint * fix: style * fix: import query * fix: import shared type * fix: affect shared/types * fix: add docker-next target * fix: nx project and infra * chore: eslint * chore: eslint * chore: remove jsx-a11y * fix: ignore css * chore: nx format:write update dirty files * Chore: adding unicorn to uber chart * fix: support values file per service * fix: cleanup * fix: added values per service * fix: only a single service please * fix: set service toplevel * fix: format * fix: use yaml not js-yaml * fix: remove release-tag arg * fix: console message * chore: remove helm values refactor * chore: remove helm values * chore: yarn charts * chore: charts update dirty files * chore: nx format:write update dirty files * chore: charts update dirty files * fix: make unaffected * Unicorn pipe (#17094) * chore: Adding pipeline for unicorns * unicorn pipe * unicorn pipe * unicorn pipe * unicorn pipe * pipetest * pipetest * pipetest * chore: nx format:write update dirty files * Update .github/workflows/unicorns.yml Co-authored-by: Jón Levy <[email protected]> * suggestions * chore: nx format:write update dirty files * unicorn pipe * suggestions --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: Jón Levy <[email protected]> * chore: charts update dirty files * chore: Adding pipeline to detect unicorns (#17165) * chore: Adding tests if pipeline should run on unicorns * chore: nx format:write update dirty files * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: find release branch * chore: nx format:write update dirty files * chore: find release branch * chore: find release branch * cleanup * branch sync * mergequeue * chore: testing pipeline * chore: nx format:write update dirty files * ignore * ignore * ignore * testing pipeline * testing pipeline * testing pipeline --------- Co-authored-by: andes-it <[email protected]> * chore: nx format:write update dirty files * chore: testing mergequeue * Adding mergequeue ci * chore: testing mergequeue * chore: testing mergequeue * Uni pr (#17280) * chore: testing mergequeue * Adding mergequeue ci * chore: testing mergequeue * chore: testing mergequeue * chore: testing mergequeue * chore: testing mergequeue * chore: nx format:write update dirty files * chore: nx format:write update dirty files * chore: testing mergequeue * chore: testing mergequeue * Uni pr (#17280) * chore: testing mergequeue * Adding mergequeue ci * chore: testing mergequeue * chore: testing mergequeue * chore: testing mergequeue --------- Co-authored-by: Jón Levy <[email protected]> Co-authored-by: andes-it <[email protected]>
- Loading branch information
1 parent
e146770
commit 19553a3
Showing
42 changed files
with
1,458 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Validate code in the merge queue | ||
|
||
on: | ||
merge_group: | ||
|
||
jobs: | ||
validate-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Display info | ||
run: | | ||
echo "Hallo Merge Queue" | ||
pwd | ||
tree -a -I '.git' | ||
git status | ||
- name: Run slow CI (emulated by a long sleep) | ||
run: sleep 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ on: | |
pull_request: | ||
types: | ||
- closed | ||
branches-ignore: | ||
- 'uni-pr' | ||
- 'feature/unicorn-app' | ||
|
||
defaults: | ||
run: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Unicorn CI/CD pipeline | ||
on: | ||
workflow_dispatch: | ||
create: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- labeled | ||
- closed | ||
pull_request_review: | ||
types: [submitted] | ||
concurrency: | ||
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value | ||
group: push-unicorn${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
printJob: | ||
name: Print event | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: | | ||
echo "$GITHUB_CONTEXT" | ||
check-approved: | ||
name: Is PR approved | ||
runs-on: ubuntu-latest | ||
outputs: | ||
IS_APPROVED: ${{ steps.check-approved.outputs.result }} | ||
steps: | ||
- name: Check if PR is approved | ||
id: check-approved | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
if (!context || !context.payload || !context.payload.pull_request) { | ||
return false; | ||
} | ||
var reviews = await github.rest.pulls.listReviews({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.issue.number | ||
}); | ||
if(!reviews || !reviews.data == null) { | ||
return false; | ||
} | ||
var declined = reviews.data.filter(review => review.state != 'APPROVED').length > 0; | ||
var pending = context.payload.pull_request.requested_teams.length > 0 | ||
console.log(!(declined && pending) ? 'Pr is approved' : 'Pr is not approved'); | ||
return !(declined && pending); | ||
- name: output | ||
run: echo "IS_APPROVED=${{ steps.check-approved.outputs.result }}" >> $GITHUB_OUTPUT | ||
|
||
check-unicorn: | ||
name: Is this a unicorn PR | ||
needs: check-approved | ||
if: ${{ needs.check-approved.outputs.IS_APPROVED }}" | ||
runs-on: ec2-runners | ||
container: | ||
image: public.ecr.aws/m3u4c4h9/island-is/actions-runner-public:latest | ||
timeout-minutes: 10 | ||
steps: | ||
- run: echo "selected runner = ${{ runner.name }}" | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'package.json' | ||
|
||
- name: Setup yarn | ||
run: corepack enable | ||
|
||
- name: Get cache | ||
id: get-cache | ||
uses: ./.github/actions/get-cache | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
enable-cache: 'node_modules,generated-files' | ||
|
||
- name: Check unicorn affected | ||
id: unicorn-affected | ||
env: | ||
BaseRef: ${{ github.base_ref }} #The target branch e.g. main (feature/unicorn-app) | ||
HeadRef: ${{ github.head_ref }} #The branch being merged e.g. (unicorn-pipe-rel3) | ||
run: | | ||
echo "Comparing nx affected for $HeadRef using origin/$BaseRef as base branch" | ||
echo IS_UNICORN=$(node scripts/ci/unicorn-utils.mjs "{\"baseBranch\": \"origin/$BaseRef\", \"mergeBranch\": \"$HeadRef\" }") >> "$GITHUB_OUTPUT" | ||
- name: Results | ||
run: | | ||
echo "Unicorn = ${{ steps.unicorn-affected.outputs.IS_UNICORN }}" | ||
- name: Find Latest Release Branch | ||
run: | | ||
node scripts/ci/get-last-release.mjs $(git branch -r) | ||
- run: "echo 'latest release: ${{ steps.get_latest_release.outputs.data }}'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ TODO | |
.env | ||
.env.* | ||
.envrc.private | ||
nx-cloud.env | ||
.nvmrc | ||
.node-version | ||
# IDE - VSCode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"rules": { | ||
"@nx/enforce-module-boundaries": [ | ||
"error", | ||
{ | ||
"enforceBuildableLibDependency": true, | ||
"allowCircularSelfDependency": true, | ||
"allow": ["../../../infra/src/dsl"], | ||
"depConstraints": [ | ||
{ | ||
"sourceTag": "*", | ||
"onlyDependOnLibsWithTags": ["*"] | ||
} | ||
] | ||
} | ||
], | ||
"simple-import-sort/imports": [ | ||
"warn", | ||
{ | ||
"groups": [ | ||
// React related packages come first, followed by all external imports. | ||
["^react", "^\\w", "^@(?!island).+"], | ||
// Then island.is packages. | ||
["^(@island.is).*"], | ||
// Then all other imports in this order: "../", "./", "./css" | ||
[ | ||
"^\\.\\.(?!/?$)", | ||
"^\\.\\./?$", | ||
"^\\./(?=.*/)(?!/?$)", | ||
"^\\.(?!/?$)", | ||
"^\\./?$", | ||
"^.+\\.?(css)$" | ||
] | ||
] | ||
} | ||
] | ||
}, | ||
"plugins": ["simple-import-sort"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
schema: | ||
- apps/api/src/api.graphql | ||
documents: apps/unicorn-app/src/queries/*.{ts,tsx} | ||
generates: | ||
apps/web/graphql/schema.ts: | ||
plugins: | ||
- typescript | ||
- typescript-operations | ||
config: | ||
exportFragmentSpreadSubTypes: true | ||
scalars: | ||
DateTime: Date | ||
JSON: '{ [key: string]: any }' | ||
namingConvention: | ||
typeNames: change-case#pascalCase | ||
apps/web/graphql/fragmentTypes.json: | ||
plugins: | ||
- fragment-matcher | ||
config: | ||
module: commonjs | ||
apolloClientVersion: 3 | ||
hooks: | ||
afterAllFileWrite: | ||
- prettier --write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
declare module '*.svg' { | ||
const content: any | ||
export const ReactComponent: any | ||
export default content | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { service, ServiceBuilder } from '../../../infra/src/dsl/dsl' | ||
const serviceName = 'unicorn-app' | ||
export const serviceSetup = (): ServiceBuilder<typeof serviceName> => | ||
service(serviceName) | ||
.image(serviceName) | ||
.namespace(serviceName) | ||
.serviceAccount(serviceName) | ||
.ingress({ | ||
primary: { | ||
host: { | ||
dev: serviceName, | ||
staging: serviceName, | ||
prod: serviceName, | ||
}, | ||
paths: ['/'], | ||
}, | ||
}) | ||
.replicaCount({ | ||
default: 1, | ||
min: 1, | ||
max: 10, | ||
}) | ||
.resources({ | ||
limits: { | ||
cpu: '200m', | ||
memory: '256Mi', | ||
}, | ||
requests: { | ||
cpu: '50m', | ||
memory: '128Mi', | ||
}, | ||
}) | ||
.liveness('/liveness') | ||
.readiness('/readiness') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'unicorn-app', | ||
preset: '../../jest.preset.js', | ||
transform: { | ||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest', | ||
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }], | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], | ||
coverageDirectory: '../../coverage/apps/unicorn-app', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//@ts-check | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { composePlugins, withNx } = require('@nx/next') | ||
|
||
/** | ||
* @type {import('@nx/next/plugins/with-nx').WithNxOptions} | ||
**/ | ||
const nextConfig = { | ||
nx: { | ||
// Set this to true if you would like to use SVGR | ||
// See: https://github.com/gregberge/svgr | ||
svgr: false, | ||
}, | ||
} | ||
|
||
const plugins = [ | ||
// Add more Next.js plugins to this list if needed. | ||
withNx, | ||
] | ||
|
||
module.exports = composePlugins(...plugins)(nextConfig) |
Oops, something went wrong.