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

Initialise app importation #362

Merged
merged 14 commits into from
Oct 27, 2020
Merged

Initialise app importation #362

merged 14 commits into from
Oct 27, 2020

Conversation

ZouhairBear
Copy link
Contributor

@ZouhairBear ZouhairBear commented Oct 22, 2020

Why?

After we added feature to export application from v2 platform to v2 platform
We will add now a feature to import applications from v2 platform to v2 platform.

Links / Ressources

#355

Actual status / Investigations

  • In SaggieUtils we already have :
  1. getAppListByProjectIdRequest : it will return the list of apps for a specific project

  2. getAppTechnologiesList : it will return the list of existing technologies

  3. updateAppVersion : it will update the version of the app

  4. getProjectCreateAppRequest : it will create an app

How?

  • class SaagieClient.groovy
  • Add new variable appsConfigFromExportedZip to importArtifacts as below :
        def appsConfigFromExportedZip = SaagieClientUtils.extractAppConfigAndPackageFromExportedApp(exportedArtifactsPathRoot)
  • change response variable in importArtifacts to
      def response = [
                status  : 'success',
                job     : [],
                pipeline: [],
                variable: [],
                app: [],
            ]
  • add methode addAppVersion(app,appVersion) : update existing app with a new version

  • class SaggieClientUtils.groovy

  • Add new variable : static final EXPORTED_APP_CONFIG_FILENAME = 'app.json'

  • add methode extractAppConfigAndPackageFromExportedApp : extract all apps configuration from the zip file that will be stored inside the variable appsConfigFromExportedZip

       ImportAppService.importAndCreateApps(
    appsConfigFromExportedZip.apps,
    configuration,
    processAppToImport
) 
  • class TechnologyService.groovy

  • add variavle appTechnologyList

  • add methode checkTechnologyIdExistInappTechnologyList : it will check if the technologyId exist in the appTechnologylist

  • Create class importVariableService that will contain this method :`

  • importAndCreateApps : will transform the extracted apps into useable objects to be used in the callback method processAppImportation

  • processAppImportation : create app and appVersion ,if the app exist ,it wil add a new version ( we need the check if the id of technoly exist)

  • Add unit tests for importing new artifact App.`

@ZouhairBear ZouhairBear changed the title fix query for getting appDetailRequest and fixer feedbacks Initialise app importation Oct 22, 2020
@ZouhairBear ZouhairBear merged commit 4042c75 into develop Oct 27, 2020
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.

2 participants