open-ux-tools icon indicating copy to clipboard operation
open-ux-tools copied to clipboard

FEATURE - Introduce confirmation deploy and undeploy prompt before executing the task

Open longieirl opened this issue 8 months ago • 0 comments

As a developer, I want to to be asked to deploy or undeploy my Fiori UI application, so that I cancel if the properties are incorrect

As a developer, I want to to be able to bypass the deploy or undeploy prompt, so that I can create CI/CD pipeline jobs without any prompting

Description

Introduce a new prompting phase into the deploy and undeploy flow, this is supported for both Adaptation projects and Fiori UI projects.

Deploy prompt

2023-11-27 17:21:17 info    abap-deploy-task: Creating archive from dist. 
2023-11-27 17:21:17 info    abap-deploy-task: Archive created from dist. 

Confirmation is required to deploy the app:

    Repository Entry: apps/cus.sd.salesorders.manage/appVariants/customer.adp.salesorder.manage3/
    Target: <my target URL>
    Transport Request: 
    Package: $TMP
    Client: 100
    Cloud: false

? Start deployment (Y/n)? › (Y/n)

Undeploy prompt

> [email protected] undeploy
> undeploy --config ui5-deploy.yaml --lrep 'apps/cus.sd.salesorders.manage/appVariants/customer.adp.salesorder.manage3/'


Confirmation is required to undeploy the app:

    Repository Entry: apps/cus.sd.salesorders.manage/appVariants/customer.adp.salesorder.manage3/
    Target: <my target URL>
    Transport Request: 

? Start undeployment (Y/n)? › (Y/n)

Sample ui5-deploy.yaml

# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json

specVersion: "3.0"
metadata:
  name: adp.salesorder.manage
type: application
builder:
  customTasks:
  - name: abap-deploy-task
    afterTask: replaceVersion
    configuration:    
      app:
        package: $TMP
        transport: ""        
      target:    
        url: <my target URL>
        client: '100'        

Technical Design

  • Enhance the deploy-tooling module
  • introduce a new dependency called chalk to handle the application info during the prompting phase

Acceptance Criteria

GivenWhenThen format (https://martinfowler.com/bliki/GivenWhenThen.html)

Given I have a ui5-deploy.yaml configuration when I execute npm run deploy or npm run undeploy then I should be prompted with a confirmation page displaying application info before executing the task

Given I have a ui5-deploy.yaml configuration when I execute npm run deploy -- --yes or npm run undeploy -- --yes then I should be able to execute the task without any prompting

Notes

Tasks

  • [ ] Update deploy-tooling to support new prompting phase
  • [ ] Unit Tests added
  • [ ] Test Cases defined

longieirl avatar Nov 27 '23 17:11 longieirl