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

refactor: move all project to dedicated repo #1726

Merged
merged 4 commits into from
Sep 26, 2024
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
130 changes: 1 addition & 129 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,6 @@ jobs:
exit 1
fi

Tests:
runs-on: "formance-runner"
needs:
- Dirty
steps:
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/env
- run: >
earthly
--no-output
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+tests
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}

TestsIntegration:
runs-on: "formance-runner"
needs:
Expand All @@ -78,112 +58,4 @@ jobs:
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+tests-integration
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}

Extract:
name: Extract
runs-on: "ubuntu-latest"
outputs:
components: ${{ steps.extract.outputs.components }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Extract service name
id: extract
run: echo "components=$(node .github/actions/find-directory/index.js)" >> $GITHUB_OUTPUT

GoReleaser:
runs-on: "ubuntu-latest"
if: contains(github.event.pull_request.labels.*.name, 'build-images') || github.ref == 'refs/heads/main' || github.event_name == 'merge_group'
needs:
- Extract
strategy:
matrix:
components: ${{ fromJson(needs.Extract.outputs.components) }}
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Setup Env
uses: ./.github/actions/env
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "NumaryBot"
password: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- run: >
earthly
--no-output
--allow-privileged
--secret SPEAKEASY_API_KEY=$SPEAKEASY_API_KEY
--secret GITHUB_TOKEN=$GITHUB_TOKEN
--secret FURY_TOKEN=$FURY_TOKEN
--secret GORELEASER_KEY=$GORELEASER_KEY
${{ contains(github.event.pull_request.labels.*.name, 'no-cache') && '--no-cache' || '' }}
+goreleaser --path=${{ matrix.components }} --mode=ci
env:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

Deploy:
runs-on: "ubuntu-latest"
if: github.ref == 'refs/heads/main'
needs:
- GoReleaser
- Tests
- TestsIntegration
steps:
- uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- uses: 'actions/checkout@v4'
with:
fetch-depth: 0
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: "staging-regions: Sset Operator, Agent, Modules tags"
env:
# Only Region deployment need the token in order to deploy with argocd
ARGOCD_REGION_AUTH_TOKEN: ${{ secrets.ARGOCD_REGION_AUTH_TOKEN }}
# Only for module
STAGING_CLUSTER_KUBECONTEXT_NAME: ${{ secrets.STAGING_CLUSTER_KUBECONTEXT_NAME }}
STAGING_CLUSTER_NAME: ${{ secrets.STAGING_CLUSTER_NAME }}
STAGING_CLUSTER_REGION: ${{ secrets.STAGING_CLUSTER_REGION }}
TAG: ${{ github.sha }}
run: >
earthly
--no-output
--secret AUTH_TOKEN=$ARGOCD_REGION_AUTH_TOKEN
+staging-application-set
--TAG=$TAG

- name: "staging-regions: Sync"
env:
# Only Region deployment need the token in order to deploy with argocd
ARGOCD_REGION_AUTH_TOKEN: ${{ secrets.ARGOCD_REGION_AUTH_TOKEN }}
STAGING_CLUSTER_KUBECONTEXT_NAME: ${{ secrets.STAGING_CLUSTER_KUBECONTEXT_NAME }}
STAGING_CLUSTER_NAME: ${{ secrets.STAGING_CLUSTER_NAME }}
STAGING_CLUSTER_REGION: ${{ secrets.STAGING_CLUSTER_REGION }}
TAG: ${{ github.sha }}
run: >
earthly
--no-output
--secret AUTH_TOKEN=$ARGOCD_REGION_AUTH_TOKEN
+staging-application-sync
--TAG=$TAG
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
21 changes: 6 additions & 15 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ IMPORT github.com/formancehq/auth:main AS auth
IMPORT github.com/formancehq/search:main AS search
IMPORT github.com/formancehq/stargate:main AS stargate
IMPORT github.com/formancehq/webhooks:main AS webhooks

IMPORT github.com/formancehq/flows:main AS orchestration
IMPORT github.com/formancehq/reconciliation:main AS reconciliation
IMPORT github.com/formancehq/wallets:main AS wallets
Comment on lines +12 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Unintended Removal of legacy Import Detected

The import statement IMPORT github.com/formancehq/legacy:main AS legacy has been unexpectedly removed from the Earthfile. Please verify if this removal was intentional to ensure it does not impact dependent components.

🔗 Analysis chain

LGTM! New imports added consistently.

The new import statements for flows, reconciliation, and wallets are consistent with the existing import style and align with the PR objective of moving projects to dedicated repositories.

To ensure all necessary imports are present, run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all required imports are present in the Earthfile

# Test: Check for the presence of all expected imports
rg --type-add 'earthfile:*.Earthfile' --type earthfile '^IMPORT github.com/formancehq/' Earthfile

Length of output: 1281


Script:

#!/bin/bash
# Description: Verify the presence of new import statements and check for unintended removals in the Earthfile

# Define the expected import statements
EXPECTED_IMPORTS=(
  'IMPORT github.com/formancehq/flows:main AS orchestration'
  'IMPORT github.com/formancehq/reconciliation:main AS reconciliation'
  'IMPORT github.com/formancehq/wallets:main AS wallets'
)

# Check for each expected import
for IMPORT in "${EXPECTED_IMPORTS[@]}"; do
  if ! rg --type-add 'earthfile:*.Earthfile' --type earthfile "^${IMPORT}$" Earthfile > /dev/null; then
    echo "Missing import: ${IMPORT}"
  fi
done

# Optionally, check that no unexpected imports have been removed
# This requires knowing the previous state or having a list of imports that should remain
# Example: Ensure that existing imports other than the new ones are still present
EXISTING_IMPORTS=(
  'IMPORT github.com/formancehq/legacy:main AS legacy'
  # Add other existing imports as needed
)

for IMPORT in "${EXISTING_IMPORTS[@]}"; do
  if ! rg --type-add 'earthfile:*.Earthfile' --type earthfile "^${IMPORT}$" Earthfile > /dev/null; then
    echo "Unexpected removal of import: ${IMPORT}"
  fi
done

Length of output: 1124


sources:
FROM core+base-image
Expand All @@ -36,10 +38,9 @@ build-final-spec:
COPY (auth+openapi/openapi.yaml) /src/ee/auth/
COPY (search+openapi/openapi.yaml) /src/ee/search/
COPY (webhooks+openapi/openapi.yaml) /src/ee/webhooks/

FOR c IN wallets reconciliation orchestration
COPY (./ee/$c+openapi/openapi.yaml) /src/ee/$c/
END
COPY (wallets+openapi/openapi.yaml) /src/ee/wallets/
COPY (reconciliation+openapi/openapi.yaml) /src/ee/reconciliation/
COPY (orchestration+openapi/openapi.yaml) /src/ee/orchestration/

RUN npm run build
RUN jq -s '.[0] * .[1]' build/generate.json openapi-overlay.json > build/latest.json
Expand Down Expand Up @@ -146,28 +147,18 @@ staging-application-set:
staging-application-sync:
BUILD core+application-sync --APPLICATION=staging-eu-west-1-hosting-regions

tests:
LOCALLY
BUILD ./components+run --TARGET=tests
BUILD ./ee+run --TARGET=tests

tests-integration:
FROM core+base-image
BUILD ./tests/integration+tests

pre-commit: # Generate the final spec and run all the pre-commit hooks
LOCALLY
BUILD ./releases+sdk-generate
BUILD ./libs+run --TARGET=pre-commit
BUILD ./components+run --TARGET=pre-commit
BUILD ./ee+run --TARGET=pre-commit
BUILD ./helm/+pre-commit
BUILD ./tests/integration+pre-commit

tidy: # Run tidy on all the components
LOCALLY
BUILD ./components+run --TARGET=tidy
BUILD ./ee+run --TARGET=tidy
BUILD ./tests/integration+tidy

tests-all:
Expand Down
20 changes: 0 additions & 20 deletions components/Earthfile

This file was deleted.

3 changes: 0 additions & 3 deletions components/operator/.dockerignore

This file was deleted.

23 changes: 0 additions & 23 deletions components/operator/.earthly/configuration/.helmignore

This file was deleted.

6 changes: 0 additions & 6 deletions components/operator/.earthly/configuration/Chart.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading