COMPUP Library
Overview
The COMPUP Library is a component upgrading library that provides the functions to upgrade each component's commit or development code. It is used by the Components Updater Tool.
Import the COMPUP library into your project. There are three modules that can be “required” within the code. Each module deals with a specific functions but they are not reliant on one another and not all three are required (but we do recommend importing all three).
require "COMPUP.COMPUPutils"
require "COMPUP.COMPUPdevUpdate"
require "COMPUP.COMPUPcommitUpdate"
How it works:
Use the Translator's built in help to review how to use each function:
COMPUPutilsGetComps - Retrieves the list of components
The function uses the /component/list API to retrieve a list of components, then filters them based on the tag provided to the function.
COMPUPdevUpdate - Updates the development code inside a given component
The function perform a git pull within a given component and its libraries using the /git/custom_command API. It also has a parameter to allow in-editor functionality.
COMPUPupdateCommit - Updates the commit on the component
Updates a component's commit to the latest commit available that is tracked by branch HEAD using the /component/set_commit API. It also has a parameter to allow in-editor functionality.
Considerations
-
Iguana timeout: If the component list is large,
iguana.call\{api="/component/list", live=true}and the subsequent per-component API calls may run for a long time and cause an Iguana Translator timeout. Consider increasing the channel or Translator timeout, or processing components in smaller batches (e.g. by using a more specific tag or splitting tags). -
Unlock Library folder for library updates: For
COMPUPdevUpdateto update shared libraries (e.g. COMPUP or other submodules under the component's dev folder), the Library folder (or the repo containing those libraries) must be writable. Unlock the Library folder in Iguana for the components that need library updates so thatgit pullcan succeed for those paths.