Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-20813

Convert ambari-web build process to use yarn package manager to fix dependencies and to make the process faster

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Task
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.5.1
    • 2.5.1
    • ambari-web
    • None


      We've seen too many build failures for Ambari even when there are no source code changes due to dependent npm packages introducing breaking changes in newer versions. This happens because npm installs the latest version of the packages allowed by the specified version patterns in package.json. Even if we fix the versions in package.json, we are still vulnerable to this issue, because the dependent packages specified in package.json can bring in their own dependencies and thus bring in new versions of these packages that can have breaking changes.
      To get around issue, we will integrate "yarn", an npm package dependency manager, to the mvn build process.
      Executing "yarn" will automatically create a "yarn.lock" file so that all the packages that are installed, including recursive dependencies, will have the exact version on subsequent installs. Note that this "yarn.lock" file needs to be checked in to the repository so that installed versions are actually fixed. An additional benefit of using "yarn" is that it dramatically speeds up npm package installs: https://yarnpkg.com/lang/en/compare/
      There's a similar dependency management tool called "npm-shrinkwrap". However, "yarn" seems superior in terms of install speed and also reproducibility of installed package versions: http://stackoverflow.com/questions/40057469/what-is-the-difference-between-yarn-lock-and-npm-shrinkwrap


        1. yarn.lock.trunk
          141 kB
          Yusaku Sako
        2. yarn.lock.branch-2.5
          105 kB
          Yusaku Sako
        3. AMBARI-20813.patch
          2 kB
          Yusaku Sako

        Issue Links


          This comment will be Viewable by All Users Viewable by All Users


            u39kun Yusaku Sako
            u39kun Yusaku Sako
            0 Vote for this issue
            2 Start watching this issue




                Issue deployment