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: GA Pack Download and Update Mechanism in the GitHub Action Environment #16541

Open
wants to merge 17 commits into
base: migration-automation-workflow
Choose a base branch
from

Conversation

JayanaGunaweera01
Copy link
Contributor

@JayanaGunaweera01 JayanaGunaweera01 commented Aug 28, 2023

Description:

This pull request introduces a significant refactor to the GA Pack download mechanism, transitioning from the GCP API key approach to using a Service Account key. By integrating a new shell script and revising the way we interact with Google Drive, aims to optimize the download process for both security and efficiency.

Key Changes Made:

1.Introduction of Service Account Key

Replaced the previous parameters (gcpClientId, gcpClientSecret, gcpRefreshToken) with a single parameter keyJsonFile that represents the Service Account key.
This transition streamlines the authentication mechanism, reducing complexity and potential points of failure.

2.Integration of download-GA-pack.sh Script

A new script, download-GA-pack.sh, has been integrated to manage the downloading of GA packs.
This script utilizes the keyJsonFile to securely fetch the required files.

3.Deprecation of Direct Google Drive Interaction

The direct curl interactions with Google Drive, which previously utilized GCP API credentials to generate access tokens and download files, have been encapsulated and refactored.
The download-GA-pack.sh script now handles these operations, ensuring a more standardized and maintainable approach.

4.Update downloaded GA packs.
Modified main shell scripts (migration-script-ubuntu.sh and migration-script-mac.sh) to update downloaded GA pack with wso2 update tool.

…loads

Created a new shell script named download-GA-pack.sh. This script has been designed to facilitate the secure downloading of GA packs directly into the GitHub environment.
Incorporated the newly created download-GA-pack.sh to handle the wso2IS zip downloading process within the existing script.

Streamlined the process by leveraging the download-GA-pack.sh script, leading to cleaner code and enhanced maintainability.
@JayanaGunaweera01 JayanaGunaweera01 changed the title Migration automation workflow Refactor: GA Pack Download Mechanism in the GitHub Environment Aug 28, 2023
@JayanaGunaweera01 JayanaGunaweera01 changed the title Refactor: GA Pack Download Mechanism in the GitHub Environment Refactor: GA Pack Download and Update Mechanism in the GitHub Action Environment Sep 3, 2023
…e-pack.sh

Remove redundant file after fixes in update-GA-pack-ubuntu.sh

The contents of the file have been addressed and fixed in update-GA-pack-ubuntu.sh, making this file obsolete.
The contents of the file have been addressed and fixed in update-GA-pack-ubuntu.sh and update-GA-pack-mac.sh, making this file obsolete.
Changes focus on refining the way the script accesses and uses the JSON credentials, with an emphasis on security and efficiency.

Previously, the value for keyJsonFile was derived from the first positional argument ($1) which was written for a file in the workflow.
In the new code, it is derived from the environment variable MIGRATION_JSON_ENCODED. After fetching the data from the variable, it gets base64-decoded to retrieve the JSON contents. This is a significant change as the way credentials are passed to the script has been altered for added security.
Added Notion User Guide of the feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant