-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #503 from stellar/release/3.1.0
Release `3.1.0` to `main`
- Loading branch information
Showing
115 changed files
with
5,597 additions
and
1,125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
name: Integration Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_call: # allows this workflow to be called from another workflow | ||
workflow_call: # allows this workflow to be called from another workflow, like `docker_image_public_release` | ||
|
||
env: | ||
USER_EMAIL: "[email protected]" | ||
|
@@ -26,6 +22,7 @@ jobs: | |
matrix: | ||
platform: | ||
- "Stellar-phone" # Stellar distribution account where receivers are registered with their phone number | ||
- "Stellar-phone-FUTURENET" # Stellar distribution account where receivers are registered with their phone number | ||
- "Stellar-phone-wallet" # Stellar distribution account where receivers are registered with their phone number and wallet address | ||
- "Stellar-email" # Stellar distribution account where receivers are registered with their email | ||
- "Circle-phone" # Circle distribution account where receivers are registered with their email | ||
|
@@ -35,26 +32,46 @@ jobs: | |
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.STELLAR.ENV" | ||
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_phone.csv" | ||
REGISTRATION_CONTACT_TYPE: "PHONE_NUMBER" | ||
DISBURSED_ASSET_CODE: "USDC" | ||
DISBURSED_ASSET_ISSUER: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" | ||
- platform: "Stellar-phone-wallet" | ||
environment: "Receiver Registration - E2E Integration Tests (Stellar)" | ||
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.STELLAR.ENV" | ||
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_phone_with_wallet.csv" | ||
REGISTRATION_CONTACT_TYPE: "PHONE_NUMBER_AND_WALLET_ADDRESS" | ||
DISBURSED_ASSET_CODE: "USDC" | ||
DISBURSED_ASSET_ISSUER: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" | ||
- platform: "Stellar-email" | ||
environment: "Receiver Registration - E2E Integration Tests (Stellar)" | ||
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.STELLAR.ENV" | ||
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_email.csv" | ||
REGISTRATION_CONTACT_TYPE: "EMAIL" | ||
DISBURSED_ASSET_CODE: "USDC" | ||
DISBURSED_ASSET_ISSUER: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" | ||
- platform: "Circle-phone" | ||
environment: "Receiver Registration - E2E Integration Tests (Circle)" | ||
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.CIRCLE.DB_VAULT" | ||
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_phone.csv" | ||
REGISTRATION_CONTACT_TYPE: "PHONE_NUMBER" | ||
DISBURSED_ASSET_CODE: "USDC" | ||
DISBURSED_ASSET_ISSUER: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" | ||
- platform: "Stellar-phone-FUTURENET" | ||
environment: "Receiver Registration - E2E Integration Tests (Stellar)" | ||
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.STELLAR.ENV" | ||
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_phone.csv" | ||
REGISTRATION_CONTACT_TYPE: "PHONE_NUMBER" | ||
DISBURSED_ASSET_CODE: "XLM" | ||
NETWORK_PASSPHRASE: "Test SDF Future Network ; October 2022" | ||
HORIZON_URL: "https://horizon-futurenet.stellar.org" | ||
environment: ${{ matrix.environment }} | ||
env: | ||
DISTRIBUTION_ACCOUNT_TYPE: ${{ matrix.DISTRIBUTION_ACCOUNT_TYPE }} | ||
DISBURSEMENT_CSV_FILE_NAME: ${{ matrix.DISBURSEMENT_CSV_FILE_NAME }} | ||
REGISTRATION_CONTACT_TYPE: ${{ matrix.REGISTRATION_CONTACT_TYPE }} | ||
DISBURSED_ASSET_CODE: ${{ matrix.DISBURSED_ASSET_CODE }} | ||
DISBURSED_ASSET_ISSUER: ${{ matrix.DISBURSED_ASSET_ISSUER }} | ||
NETWORK_PASSPHRASE: ${{ matrix.NETWORK_PASSPHRASE }} | ||
HORIZON_URL: ${{ matrix.HORIZON_URL }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -73,6 +90,28 @@ jobs: | |
run: sudo apt-get update && sudo apt-get install -y curl | ||
shell: bash | ||
|
||
- name: Wait for the SDP to be up | ||
run: | | ||
wait_for_server() { | ||
local endpoint=$1 | ||
local max_wait_time=$2 | ||
SECONDS=0 | ||
while ! curl -s $endpoint > /dev/null; do | ||
echo "Waiting for server at $endpoint to be up... $SECONDS seconds elapsed" | ||
sleep 4 | ||
if [ $SECONDS -ge $max_wait_time ]; then | ||
echo "Server at $endpoint is not up after $max_wait_time seconds." | ||
exit 1 | ||
fi | ||
done | ||
echo "Server at $endpoint is up." | ||
} | ||
wait_for_server http://localhost:8000/health 120 | ||
wait_for_server http://localhost:8003/health 120 | ||
shell: bash | ||
|
||
- name: Create integration test data | ||
run: | | ||
docker exec e2e-sdp-api bash -c "./stellar-disbursement-platform integration-tests create-data" | ||
|
@@ -83,7 +122,7 @@ jobs: | |
docker restart e2e-anchor-platform | ||
shell: bash | ||
|
||
- name: Wait for Anchor Platform at both localhost:8080/health and localhost:8085/health | ||
- name: Wait for the Anchor Platform to be up | ||
run: | | ||
wait_for_server() { | ||
local endpoint=$1 | ||
|
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
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
7 changes: 7 additions & 0 deletions
7
db/migrations/auth-migrations/2024-11-29.0-sanitize-email-auth_users-table.sql
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,7 @@ | ||
-- +migrate Up | ||
UPDATE auth_users | ||
SET | ||
email = LOWER(TRIM(email)); | ||
|
||
-- +migrate Down | ||
-- No down migration needed as email sanitization cannot be reversed |
52 changes: 52 additions & 0 deletions
52
db/migrations/sdp-migrations/2024-12-10.0-circle-payouts-support.sql
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,52 @@ | ||
-- prepares the database for Circle payouts by adding the new circle_recipients table, and modifying circle_transfers to be used for payouts. | ||
|
||
-- +migrate Up | ||
-- circle_recipients | ||
CREATE TYPE circle_recipient_status AS ENUM ('pending', 'active', 'inactive', 'denied'); | ||
|
||
CREATE TABLE circle_recipients ( | ||
receiver_wallet_id VARCHAR(36) PRIMARY KEY, | ||
idempotency_key VARCHAR(36) NOT NULL DEFAULT public.uuid_generate_v4(), | ||
circle_recipient_id VARCHAR(36), | ||
status circle_recipient_status, | ||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), | ||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), | ||
sync_attempts INT NOT NULL DEFAULT 0, | ||
last_sync_attempt_at TIMESTAMPTZ, | ||
response_body JSONB, | ||
CONSTRAINT unique_idempotency_key UNIQUE (idempotency_key) | ||
); | ||
|
||
-- Create a partial unique index for circle_recipient_id only when it's NOT NULL | ||
CREATE UNIQUE INDEX unique_circle_recipient_id ON circle_recipients(circle_recipient_id) | ||
WHERE circle_recipient_id IS NOT NULL; | ||
|
||
CREATE TRIGGER refresh_circle_recipient_updated_at BEFORE UPDATE ON circle_recipients FOR EACH ROW EXECUTE PROCEDURE update_at_refresh(); | ||
|
||
-- circle_transfer_requests | ||
ALTER TABLE circle_transfer_requests | ||
ADD COLUMN circle_payout_id VARCHAR(36), | ||
ADD CONSTRAINT circle_transfer_or_payout CHECK ( | ||
NOT (circle_transfer_id IS NOT NULL AND circle_payout_id IS NOT NULL) | ||
); | ||
|
||
-- status indexes | ||
CREATE INDEX idx_payments_status ON payments(status); | ||
CREATE INDEX idx_disbursements_status ON disbursements(status); | ||
CREATE INDEX idx_receiver_wallets_status ON receiver_wallets(status); | ||
|
||
-- +migrate Down | ||
-- status indexes | ||
DROP INDEX IF EXISTS idx_payments_status; | ||
DROP INDEX IF EXISTS idx_disbursements_status; | ||
DROP INDEX IF EXISTS idx_receiver_wallets_status; | ||
|
||
-- circle_transfer_requests | ||
ALTER TABLE circle_transfer_requests | ||
DROP CONSTRAINT circle_transfer_or_payout, | ||
DROP COLUMN circle_payout_id CASCADE; | ||
|
||
-- circle_recipients | ||
DROP TRIGGER refresh_circle_recipient_updated_at ON circle_recipients; | ||
DROP TABLE circle_recipients CASCADE; | ||
DROP TYPE circle_recipient_status; |
Oops, something went wrong.