Migrating Your Existing Workflows to Use GitHub Apps
Dockstore 1.9.0 provides users with a way to keep their workflows automatically updated (instead of needing to manually refresh) by using GitHub apps. Here, we will go over how to migrate your existing Dockstore workflows to use our GitHub App.
GitHub App Installation
The first step to migrating a workflow is the same as adding a new workflow via GitHub Apps: install our Dockstore GitHub App onto your repository or organization, if you have not already done so.
Installing the GitHub App is simple. Navigate to
/my-services using the drop down menu in the top right. In these screenshots, we will go via
/my-tools, but the process is essentially the same for any of the other options.
+ button on the left hand sidebar.
A window will appear asking how you would like to register your tool, workflow, or service. Select
Register using GitHub Apps.
+ Manage Dockstore Installation on GitHub. You’ll then be redirected to GitHub where you can select which repositories can be accessed by the GitHub app.
You’ll then be redirected to GitHub where you can grant the app access to specific repositories within whatever organization you are installing into. Note that GitHub treats your username as its own “organization.” For instance, my GitHub username is aofarrel. If I want to install the GitHub App so it could access aofarrel/mycoolrepo, I would choose the first option here.
After selection of an organization, you can select whether to give access to all repositories or only select ones. If the organization you choose is intended to be just for Dockstore tools/workflows/services, you may want to allow access to all repositories. Otherwise, it is may be more intuitive to select only certain repositories. Click save and you will be taken back to the page you started on in Dockstore – either
/my-services, depending where you started.
The GitHub user who first adds a workflow onto Dockstore must correspond to a user on Dockstore.
You should now see the organization and the repositories you chose to keep track of in the “unpublished” tab. Here’s an example involving
A note on permissions
If you are adding the GitHub App to an organization for which you are not an admin, GitHub may block your ability to install the app, even if you have maintainer access to the repository you are hoping to give the GitHub App permission to view. Please see this FAQ entry for more information.
Automatic Syncing with GitHub Apps and .dockstore.yml - details on writing a .dockstore.yml file
Migrating Your Existing Workflows - a tutorial on converting already registered workflows
Troubleshooting and FAQ - tips on resolving Dockstore Github App issues.
Once the GitHub App is installed and a .dockstore.yml is present, please make sure to push one additional commit to your repository. This helps make sure your workflows, tools, and services show up in Dockstore.
A Note on Naming Workflows on Dockstore
Workflow paths are unique, descriptive identifiers for a workflow. In other words, each workflow on Dockstore has a unique identifier in the form of a path. This path is based on the Git repository that the workflow comes from. There are four components to a path, but only three are required. It has the following structure:
<sourceControl>/<organization name>/<repository name>/<optional workflow name>:<version name>
Why not simply use a number to identify the workflow? With a path like that shown above, users can quickly understand the purpose of a workflow along with where it came from.
Ex. If I had a GitHub repository called BAMstats that existed in the OICR organization, and I did not give the workflow an optional name, the path of the workflow created from that repository would be the following:
The final optional component for the workflow path is the workflow name. This is a user defined string that will be appended to the end of the required workflow path. It is useful in two situations:
The name of the repository doesn’t represent the workflow, or
The repository contains multiple workflows
Using the previous example, we could set the workflow name to
coverage. Our path would now be:
If we set the workflow name, we must include it in our path when referencing the workflow. You also should be aware of a workflow’s name when it comes to migrating a workflow registered via legacy methods to GitHub App registration methods. During the migration process, be sure to include the workflow’s name as a field on your .dockstore.yml file.
Creating a .dockstore.yml File
Once the GitHub app is installed on the correct repo, the next step is to create a .dockstore.yml file. We’ll cover a very straightforward example first, but depending on how you configured the workflow during registration and whether your GitHub repository houses multiple workflows published on Dockstore, there will be additional steps to writing your .dockstore.yml file.
Let’s say we have the following CWL workflow registered on Dockstore that came from this repository and you would like to convert the master branch.
As noted in our other documentation, create a .dockstore.yml file in the root directory of the branch you want to migrate (in this example, it’s the master branch) in your repository. The file should look like the following
version: 1.2 workflows: - subclass: CWL primaryDescriptorPath: /Dockstore.cwl testParameterFiles: - /test/dockstore.cwl.json
The information above was filled out using the following:
subclassis taken from the
Test File Path
During the original registration for your workflow, you may have filled out the
Workflow Name field shown in the picture below.
To check if the workflow you want to migrate has a workflow name set, select the workflow and look at the title on top, seeing if it has a fourth component to its title. As mentioned above, if you see a workflow name inserted, you must include the name field in your .dockstore.yml file.
version: 1.2 workflows: - subclass: CWL primaryDescriptorPath: /Dockstore.cwl testParameterFiles: - /test/dockstore.cwl.json name: optional-name
If you have multiple workflows registered on Dockstore that stem from the same GitHub repo, a single .dockstore.yml can be used to convert them.
Again, you need to check for the Workflow Name field being set because it’s needed for multi workflow repositories.
If the name field in the
dockstore.yml doesn’t match the Workflow Name field in Dockstore, the migration of your workflow on Dockstore will not go through and it will instead create a new Dockstore entry.
Let’s say we want to convert these two workflows that come from this repository.
Your .dockstore.yml would look like the following:
version: 1.2 workflows: - subclass: CWL primaryDescriptorPath: /Dockstore.cwl testParameterFiles: - /test/dockstore.cwl.json - subclass: WDL primaryDescriptorPath: /Dockstore.wdl testParameterFiles: - /test/dockstore.wdl.json name: optional-name
Testing the Migration
Push events will only be captured by Dockstore after installing the GitHub app onto the repo.
To test out your GitHub app integration, make a push to a branch. Navigate to or refresh your browser on the My Workflows page, and select the workflow you wanted to convert.
You should see that the
Workflow Information section looks a bit different.
It now lists the mode as
Automatically synced via GitHub App instead of
Full, and information about paths is no longer included.
You are also no longer able to refresh or restub the workflow any more. Since you can’t refresh the entire workflow anymore, new versions from GitHub (releases/branches) that you want to add to Dockstore must have a .dockstore.yml file.
However, you can still refresh already existing versions/branches on Dockstore that you haven’t converted by going to the Versions tab, clicking Actions, and selecting Refresh Version.
Troubleshooting and FAQ - tips on resolving Dockstore GitHub App issues.