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

Uni pr #17308

Merged
merged 56 commits into from
Dec 20, 2024
Merged

Uni pr #17308

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4e21523
feat: cd test app
busla Nov 5, 2024
751f1fe
fix: rename app
busla Nov 6, 2024
d782605
fix: name
busla Nov 6, 2024
1842bf3
fix: added dummy queries and codegen target
busla Nov 6, 2024
4fd5dd2
fix: eslint
busla Nov 6, 2024
3a17000
fix: style
busla Nov 6, 2024
93e771b
fix: import query
busla Nov 6, 2024
dc5a66f
fix: import shared type
busla Nov 6, 2024
b7a2b70
fix: affect shared/types
busla Nov 6, 2024
6872af9
fix: add docker-next target
busla Nov 7, 2024
753474b
fix: nx project and infra
busla Nov 7, 2024
1576442
chore: eslint
busla Nov 7, 2024
f191a17
chore: eslint
busla Nov 7, 2024
d413f7d
chore: remove jsx-a11y
busla Nov 7, 2024
eb29083
fix: ignore css
busla Nov 7, 2024
8683b6e
chore: nx format:write update dirty files
andes-it Nov 7, 2024
f56de23
Chore: adding unicorn to uber chart
robertaandersen Nov 11, 2024
002c1ac
fix: support values file per service
busla Nov 12, 2024
31c2fb8
fix: cleanup
busla Nov 12, 2024
d00cc78
fix: added values per service
busla Nov 13, 2024
7277b88
fix: only a single service please
busla Nov 13, 2024
8b013d6
fix: set service toplevel
busla Nov 13, 2024
05ef4e8
fix: format
busla Nov 13, 2024
edf473e
fix: use yaml not js-yaml
busla Nov 13, 2024
180940d
fix: remove release-tag arg
busla Nov 13, 2024
2c4c51d
fix: console message
busla Nov 13, 2024
498a91c
chore: remove helm values refactor
busla Nov 13, 2024
aefc18b
chore: remove helm values
busla Nov 13, 2024
5818e55
chore: yarn charts
busla Nov 13, 2024
88f95e0
Merge branch 'main' into feature/unicorn-app
busla Nov 13, 2024
e045ec4
chore: charts update dirty files
andes-it Nov 13, 2024
83e46dc
chore: nx format:write update dirty files
andes-it Nov 13, 2024
e222e46
Merge branch 'main' into feature/unicorn-app
busla Nov 27, 2024
080e58d
chore: charts update dirty files
andes-it Nov 27, 2024
0166607
fix: make unaffected
busla Nov 27, 2024
7ffbbc9
Merge branch 'feature/unicorn-app' of github.com:island-is/island.is …
busla Nov 27, 2024
e3f87ba
Unicorn pipe (#17094)
robertaandersen Dec 2, 2024
81884c9
Merge remote-tracking branch 'origin/main' into feature/unicorn-app
robertaandersen Dec 18, 2024
f750e39
chore: charts update dirty files
andes-it Dec 18, 2024
2b74fe9
chore: Adding pipeline to detect unicorns (#17165)
robertaandersen Dec 18, 2024
2455ee5
chore: nx format:write update dirty files
andes-it Dec 18, 2024
849d90a
chore: testing mergequeue
robertaandersen Dec 18, 2024
fd9279d
Adding mergequeue ci
robertaandersen Dec 18, 2024
30eae3a
chore: testing mergequeue
robertaandersen Dec 18, 2024
adfa2e8
chore: testing mergequeue
robertaandersen Dec 18, 2024
cc0758b
Uni pr (#17280)
robertaandersen Dec 18, 2024
f3482ae
chore: testing mergequeue
robertaandersen Dec 18, 2024
78b8a57
chore: testing mergequeue
robertaandersen Dec 18, 2024
4d4aef0
chore: nx format:write update dirty files
andes-it Dec 18, 2024
c6d1bff
chore: nx format:write update dirty files
andes-it Dec 18, 2024
309e969
chore: testing mergequeue
robertaandersen Dec 18, 2024
caf2734
chore: testing mergequeue
robertaandersen Dec 20, 2024
3f250d1
Uni pr (#17280)
robertaandersen Dec 18, 2024
221eebf
Merge remote-tracking branch 'origin/feature/unicorn-app' into uni-pr
robertaandersen Dec 20, 2024
8512436
chore: testing mergequeue
robertaandersen Dec 20, 2024
6d70ce9
Merge branch 'main' into uni-pr
robertaandersen Dec 20, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/config-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ on:
- 'main'
- 'release/**'
- 'pre-release/**'
- '!unicorn-pipe-rel3'
- '!feature/unicorn-app'
paths:
- 'charts/**'
- 'infra/**'
- '**/infra/**'
workflow_dispatch: {}
pull_request:
branches:
- '!uni-pr'
- '!feature/unicorn-app'
paths:
- 'charts/**'
- 'infra/**'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/external-checks.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: External checks

on:
pull_request: {}
pull_request:
branches-ignore:
- 'feature/unicorn-app'
workflow_dispatch: {}

defaults:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/merge-queue-ci.yml
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
3 changes: 3 additions & 0 deletions .github/workflows/pullrequest-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
types:
- closed
branches-ignore:
- 'uni-pr'
- 'feature/unicorn-app'

defaults:
run:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pullrequest-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- reopened
- edited
- synchronize
branches-ignore:
- 'uni-pr'
- 'feature/unicorn-app'

defaults:
run:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Monorepo pipeline - pull request

on:
pull_request: {}
pull_request:
branches-ignore:
- 'uni-pr'
- 'feature/unicorn-app'
workflow_dispatch: {}

defaults:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ on:
- 'main'
- 'release/**'
- 'pre-release/**'
- '!uni-pr'
- '!feature/unicorn-app'
paths-ignore:
- '**/*.md'
tags:
- docker-build-*
workflow_dispatch:
create:
pull_request:
branches:
- '!uni-pr'
- '!feature/unicorn-app'
types:
- opened
- synchronize
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/revert-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ on:
- completed
branches:
- main
- '!uni-pr'
- '!feature/unicorn-app'
pull_request:
branches:
- '!uni-pr'
types:
- opened
- synchronize
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/unicorns.yml
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 }}'"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TODO
.env
.env.*
.envrc.private
nx-cloud.env
.nvmrc
.node-version
# IDE - VSCode
Expand Down
55 changes: 55 additions & 0 deletions apps/unicorn-app/.eslintrc.json
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": {}
}
]
}
24 changes: 24 additions & 0 deletions apps/unicorn-app/codegen.yml
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
6 changes: 6 additions & 0 deletions apps/unicorn-app/index.d.ts
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
}
34 changes: 34 additions & 0 deletions apps/unicorn-app/infra/infra.ts
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')
11 changes: 11 additions & 0 deletions apps/unicorn-app/jest.config.ts
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',
}
5 changes: 5 additions & 0 deletions apps/unicorn-app/next-env.d.ts
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.
22 changes: 22 additions & 0 deletions apps/unicorn-app/next.config.js
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)
Loading
Loading