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

Create Latest Release #1137

Merged
merged 23 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
13ff2d0
Feature/ns to gw (#1071)
ikethecoder Aug 14, 2024
b902ab0
Merge pull request #1134 from bcgov/dev
rustyjux Aug 15, 2024
c8ac094
scroll to top, fix redirect for gateway detail
rustyjux Aug 28, 2024
5390685
Cypress/ns to gw cli tests (#1158)
rustyjux Aug 28, 2024
43994fa
replace Namespace with Gateway in org permission (#1159)
rustyjux Aug 29, 2024
76a0187
a few fixes for Namespace to Gateway update (#1161)
rustyjux Aug 29, 2024
ba687c1
Feature/ns to gw redirect (#1162)
rustyjux Sep 9, 2024
56ec50e
Merge branch 'test' into dev
rustyjux Sep 9, 2024
7355065
more details on login
rustyjux Sep 10, 2024
ee9ed4f
show error for invalid display name format
rustyjux May 3, 2024
70a9627
reset edit display name input on cancel
rustyjux Sep 12, 2024
68d9315
avoid white bg on button hover if disabled
rustyjux Sep 12, 2024
952c33d
match GatewayController activity in OrgController v3 (#1171)
rustyjux Sep 12, 2024
b95e4f5
More Namespace to Gateway changes and fixes (#1170)
rustyjux Sep 12, 2024
0a07cdc
reduce timeout (#1177)
rustyjux Sep 13, 2024
fc3499e
adjust timeout for redirect
rustyjux Sep 13, 2024
0122aa1
clickable items in Gateways list
rustyjux Sep 13, 2024
e27499a
use inline styles
rustyjux Sep 13, 2024
9ba051e
Merge pull request #1179 from bcgov/feature/click-gateway-item
Elson9 Sep 19, 2024
d6e85bb
Feature/gw redirect (#1178)
rustyjux Sep 19, 2024
549d9a5
Resolve merge conflicts
Elson9 Sep 19, 2024
73f309d
Resolve conflicts pt.2
Elson9 Sep 19, 2024
26f32c4
Merge pull request #1180 from bcgov/dev
Elson9 Sep 19, 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
21 changes: 20 additions & 1 deletion .env.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LOG_LEVEL=info
LOG_LEVEL=debug
DISABLE_LOGGING='true'
AUTH_STRATEGY=Oauth2Proxy
KNEX_HOST=kong-db
Expand Down Expand Up @@ -27,7 +27,26 @@ LOCAL_ENV=true
WORKING_PATH=/tmp
DESTINATION_URL=
SSR_API_ROOT=http://apsportal.localtest.me:3000
NEXT_PUBLIC_APP_VERSION=0.0.0
NEXT_PUBLIC_APP_REVISION=000000000000000000000000
NEXT_PUBLIC_KUBE_CLUSTER=local
NEXT_PUBLIC_HELP_DESK_URL=https://dpdd.atlassian.net/servicedesk/customer/portal/1/group/2
NEXT_PUBLIC_HELP_CHAT_URL=https://chat.developer.gov.bc.ca/channel/aps-ops
NEXT_PUBLIC_HELP_ISSUE_URL=https://github.com/bcgov/api-services-portal/issues
NEXT_PUBLIC_HELP_API_DOCS_URL=/ds/api/v3/console/
NEXT_PUBLIC_HELP_SUPPORT_URL=https://dev.developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/
NEXT_PUBLIC_HELP_RELEASE_URL=https://dev.developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/reference/releases/
NEXT_PUBLIC_HELP_STATUS_URL=https://uptime.com/s/bcgov-dss
NEXT_PUBLIC_DEVELOPER_IDS=idir,bceid,bcsc,github
NEXT_PUBLIC_PROVIDER_IDS=idir
NEXT_PUBLIC_ACCOUNT_BCEID_URL=https://www.test.bceid.ca/logon.aspx?returnUrl=/profile_management
NEXT_PUBLIC_ACCOUNT_BCSC_URL=https://idtest.gov.bc.ca/account/
NEXT_PUBLIC_GRAFANA_URL=https://grafana.local


# For automated integrated testing
TEST_PORTAL_CLIENT_ID=aps-portal
TEST_PORTAL_CLIENT_SECRET=8e1a17ed-cb93-4806-ac32-e303d1c86018
TEST_PORTAL_USERNAME=janis@idir
TEST_PORTAL_PASSWORD=awsummer

26 changes: 20 additions & 6 deletions .github/workflows/aps-cypress-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ jobs:
fi
done

- name: Upload E2E Test Results Report
uses: actions/upload-artifact@v2
- name: Upload E2E Test Results HTML Report
uses: actions/upload-artifact@v4
with:
name: test-results
name: test-results-html
path: ${{ github.workspace }}/e2e/results/report

- name: Upload E2E Test Results JSON Report
uses: actions/upload-artifact@v4
with:
name: test-results-json
path: ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json

- name: Upload E2E Code Coverage Report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: ${{ github.workspace }}/e2e/coverage
Expand Down Expand Up @@ -100,8 +106,16 @@ jobs:
run: |
FAILURE_COUNT=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq '.stats.failures')
if [[ "$FAILURE_COUNT" -gt 0 ]]; then
FAILED_TESTS=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq '.results | .[] | .suites | .[].tests | .[] | select(.fail==true) | .title')
STATS=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq '.stats')
FAILED_TESTS=$(jq -r '
.results[] |
(.file | split("/") | .[2:] | join("/")) as $file |
.. |
.tests? // empty |
.[] |
select(.fail == true) |
"- " + $file + " - " + .title
' ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json)
STATS=$(cat ${{ github.workspace }}/e2e/results/bcgov-aps-e2e-report.json | jq -r '.stats | to_entries | map("\(.key)\t\(.value)") | .[]' | column -t)
echo -e "Stats: $STATS\n\nFailed Tests:\n$FAILED_TESTS\n\nRun Link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" > msg
export MSG=$(cat msg)
gh issue create --title "FAILED: Automated Tests($FAILURE_COUNT)" --body "$MSG" --label "automation" --assignee "${{ env.GIT_COMMIT_AUTHOR }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ jobs:
NEXT_PUBLIC_HELP_ISSUE_URL:
value: 'https://github.com/bcgov/api-services-portal/issues'
NEXT_PUBLIC_HELP_API_DOCS_URL:
value: '/ds/api/v2/console/'
value: '/ds/api/v3/console/'
NEXT_PUBLIC_HELP_SUPPORT_URL:
value: 'https://developer.gov.bc.ca/docs/default/component/aps-infra-platform-docs/'
NEXT_PUBLIC_HELP_RELEASE_URL:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-feat-sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Run Tests
run: |
docker compose up kong-db -d
docker compose up keycloak -d

set -o allexport
source ./.env.local
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Run this command to test logging in and creating a namespace:

```
gwa login
gwa namespace create --name gw-12345
gwa gateway create --gateway-id gw-12345
```

### Keycloak configuration
Expand All @@ -67,17 +67,19 @@ Use the following configuration to run the Portal locally (outside of Docker) ag

1. If using Node version > 17, run `npm install --legacy-peer-deps`

1. Turn off the docker compose Portal: `docker stop apsportal`
1. Configure the `oauth2-proxy` that is running in Docker:
1. Turn off the docker compose Portal and OAuth2 Proxy: `docker stop apsportal oauth2-proxy`

1. Update `upstreams` in `local/oauth2-proxy/oauth2-proxy-local.cfg` to include the IP address of your local machine, e.g. `upstreams=["http://172.100.100.01:3000"]`
<br>You can obtain the IP address using `hostname -I`.
1. Start the OAuth2 Proxy locally:

1. Restart the oauth2-proxy: `docker compose restart oauth2-proxy`
1. Update `DESTINATION_URL` in `local/feeds/.env.local` to include the IP address of your local machine
1. Restart the feeder: `docker compose restart feeder`
1. Update `PORTAL_ACTIVITY_URL` in `local/gwa-api/.env.local` to include the IP address of your local machine
1. Restart the feeder: `docker compose restart gwa-api`
```sh
hostip=$(ifconfig en0 | awk '$1 == "inet" {print $2}')

docker run -ti --rm --name proxy --net=host \
--add-host portal.localtest.me:$hostip \
-v `pwd`/local/oauth2-proxy/oauth2-proxy-dev.cfg:/oauth2.config \
quay.io/oauth2-proxy/oauth2-proxy:v7.2.0 \
--config /oauth2.config
```

1. Start the Portal locally:

Expand Down
2 changes: 1 addition & 1 deletion e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ COPY e2e/*.yml /e2e
COPY e2e/entrypoint.sh /tmp
ADD e2e/cypress /e2e/cypress

RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v2.0.15/gwa_Linux_x86_64.tgz \
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.4/gwa_Linux_x86_64.tgz \
&& tar -xzf gwa_Linux_x86_64.tgz \
&& mv gwa /usr/local/bin/.

Expand Down
7 changes: 6 additions & 1 deletion e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export default defineConfig({
'./cypress/tests/16-*/*.ts',
'./cypress/tests/17-*/*.ts',
'./cypress/tests/18-*/*.ts',
'./cypress/tests/19-*/*.ts',
'./cypress/tests/20-*/*.ts',
]
return config
},
Expand All @@ -57,9 +59,10 @@ export default defineConfig({
},
chromeWebSecurity: false,
env: {
ASTRA_SCAN_ENABLED: true,
CLIENT_ID: 'aps-portal',
CLIENT_SECRET: '8e1a17ed-cb93-4806-ac32-e303d1c86018',
OIDC_ISSUER: 'http://keycloak.localtest.me:9081',
OIDC_ISSUER: 'http://keycloak.localtest.me:9081/auth/realms/master',
TOKEN_URL:
'http://keycloak.localtest.me:9081/auth/realms/master/protocol/openid-connect/token',
GWA_API_URL: 'http://gwa-api.localtest.me:2000/v2',
Expand All @@ -69,6 +72,8 @@ export default defineConfig({
BASE_URL: 'http://oauth2proxy.localtest.me:4180',
KEYCLOAK_URL: 'http://keycloak.localtest.me:9081',
WEBAPP_URL: 'http://html-sample-app.localtest.me:4242',
DEV_USERNAME: 'janis@idir',
DEV_PASSWORD: 'awsummer',
},
retries: {
runMode: 2,
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/fixtures/access-manager.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"namespace": "permission"
},
"serviceAccount": {
"scopes": ["GatewayConfig.Publish", "Namespace.Manage", "Content.Publish"]
"scopes": ["GatewayConfig.Publish", "Gateway.Manage", "Content.Publish"]
},
"labels_consumer1": {
"labels": {
Expand Down
Loading
Loading