dpc-sdp / ripple

Ripple is the frontend framework for Single Digital Presence, delivered using Nuxt and Vue.js
Apache License 2.0
61 stars 37 forks source link

Updated nightwatch workflow inputs and added Estuary app to trigger workflow #1319

Closed MarkCalvert closed 8 months ago

MarkCalvert commented 9 months ago

Changed

  1. Updated the nightwatch workflow input names to match what the estuary API expects to send to the GitHub workflows. https://github.com/dpc-sdp/estuary/blob/79da49c5866435436a14795c288fc8a9a2cceaa4/pkg/github/server.go#L53
  2. Removed E2E input and logic
  3. Updated trigger-e2e.sh script to use the Estuary app to trigger e2e testing.
MarkCalvert commented 8 months ago

Hey @FleetAdmiralButter @tim-yao , I successfully triggered the e2e tests via estuary on a Lagoon Build. https://dashboard.amazeeio.cloud/projects/ripple/ripple-pr-1319/deployments/lagoon-build-uazonj https://github.com/dpc-sdp/ripple/actions/runs/6488552014. For testing, I have added two env variables to the project using Lagoon CLI E2E_ESTUARY_URL & E2E_ESTUARY_TOKEN_PATH. I believe these are managed somewhere else for SDP?

tim-yao commented 8 months ago

Hey @FleetAdmiralButter @tim-yao , I successfully triggered the e2e tests via estuary on a Lagoon Build. https://dashboard.amazeeio.cloud/projects/ripple/ripple-pr-1319/deployments/lagoon-build-uazonj https://github.com/dpc-sdp/ripple/actions/runs/6488552014. For testing, I have added two env variables to the project using Lagoon CLI E2E_ESTUARY_URL & E2E_ESTUARY_TOKEN_PATH. I believe these are managed somewhere else for SDP?

I can see the triggered action. So I guess it's working as expected? For the two new vars, @FleetAdmiralButter do you have any suggestion?

FleetAdmiralButter commented 8 months ago

Hi @tim-yao @MarkCalvert, since E2E_ESTUARY_URL and E2E_ESTUARY_TOKEN_PATH are consumed by a script in the Lagoon project itself, it should be configured in CMDB as a build-time variable.

Though I don't think we need to configure E2E_ESTUARY_TOKEN_PATH - the path to the service account token will always be in /run/secrets/kubernetes.io/serviceaccount/token.

tim-yao commented 8 months ago

Hi @tim-yao @MarkCalvert, since E2E_ESTUARY_URL and E2E_ESTUARY_TOKEN_PATH are consumed by a script in the Lagoon project itself, it should be configured in CMDB as a build-time variable.

Though I don't think we need to configure E2E_ESTUARY_TOKEN_PATH - the path to the service account token will always be in /run/secrets/kubernetes.io/serviceaccount/token.

I support fewer vars, it can reduce the maintenance work but it's up to you guys to decide.

MarkCalvert commented 8 months ago

Hi @tim-yao @MarkCalvert, since E2E_ESTUARY_URL and E2E_ESTUARY_TOKEN_PATH are consumed by a script in the Lagoon project itself, it should be configured in CMDB as a build-time variable. Though I don't think we need to configure E2E_ESTUARY_TOKEN_PATH - the path to the service account token will always be in /run/secrets/kubernetes.io/serviceaccount/token.

I support fewer vars, it can reduce the maintenance work but it's up to you guys to decide.

@tim-yao @FleetAdmiralButter I don't have access to CMDB, so can one of you add the variables? I added the token path as an env variable for security reasons because this repo is public. However, we would have to delete the commits and this PR somehow....

tim-yao commented 8 months ago

@FleetAdmiralButter @MarkCalvert I would like to change the workflow name to e2e instead of nightwatch later. Like https://github.com/dpc-sdp/fvrim-vic-gov-au/pull/103/files. It can be another PR, so no change is required in this PR. Thanks!

tim-yao commented 8 months ago

Hi @tim-yao @MarkCalvert, since E2E_ESTUARY_URL and E2E_ESTUARY_TOKEN_PATH are consumed by a script in the Lagoon project itself, it should be configured in CMDB as a build-time variable. Though I don't think we need to configure E2E_ESTUARY_TOKEN_PATH - the path to the service account token will always be in /run/secrets/kubernetes.io/serviceaccount/token.

I support fewer vars, it can reduce the maintenance work but it's up to you guys to decide.

@tim-yao @FleetAdmiralButter I don't have access to CMDB, so can one of you add the variables? I added the token path as an env variable for security reasons because this repo is public. However, we would have to delete the commits and this PR somehow....

@FleetAdmiralButter It will need to be implemented into existing projects and new project templates. I am not sure what's the best way to do it now. Can you help on this? Thanks!

FleetAdmiralButter commented 8 months ago

@MarkCalvert The path to the service account token (/run/secrets/kubernetes.io/serviceaccount/token) is a standard path in Kubernetes, so technically that information is public already.

Could we set default values in the script? Like:

E2E_ESTUARY_URL="${E2E_ESTUARY_URL:-http://estuary.sdp-services/}"
E2E_ESTUARY_TOKEN_PATH ="${E2E_ESTUARY_TOKEN_PATH:-/run/secrets/kubernetes.io/serviceaccount/token}"
MarkCalvert commented 8 months ago

@MarkCalvert The path to the service account token (/run/secrets/kubernetes.io/serviceaccount/token) is a standard path in Kubernetes, so technically that information is public already.

Could we set default values in the script? Like:

E2E_ESTUARY_URL="${E2E_ESTUARY_URL:-http://estuary.sdp-services/}"
E2E_ESTUARY_TOKEN_PATH ="${E2E_ESTUARY_TOKEN_PATH:-/run/secrets/kubernetes.io/serviceaccount/token}"

@FleetAdmiralButter Ahh I see, good to know. Yes we can set the default values like that.

MarkCalvert commented 8 months ago

Removed the env variables using Lagoon CLI and added default values in the script. E2E workflow was triggered on lagoon build https://github.com/dpc-sdp/ripple/actions/runs/6491017510