Indeed, a pull request should be submitted against master to have the extension built for the Slicer Preview and against the latest X.Y branch to have the extension built for the latest stable release.
The scm_revision field should indeed be set to the revision (either a SHA or a branch name) associated with your extension repository.
Branch name: you can use any branch name, but to be consistent with all new repositories (and an increasing number of existing repositories) and thereby avoid any complications, I would recommend using the current default: main. Using the old default - master - indicates that the project is unable or unwilling to follow current trends, which may slightly discourage some potential contributors and funding sources. Changing the branch name (e.g., pushing master branch content to main and change th3 default branch in github) takes a few minutes.
scm_revision: Using a git hash allows you to specify exactly what extension source code has to be used with what Slicer version, but you need to update this git hash in the extensions index each time you update your extension. Using a branch name makes it difficult to determine exactly what extension version was compatible with an older Slicer version; but it is more convenient, because you do not have to send a pull request to the extensions index after each extension change (the latest version is picked up automatically each night).
@jcfr Would you prefer extension developers to generate a pull request after each change? Most extension developers don’t do this and I would much prefer not to do this for the dozens of extensions that I maintain. I would be ready to switch to using git hash if a pull request was automatically generated by a single click or when a new github release is created for thr extension. However, until then I would not require developers to use git hash.
Instead, this will be automated like what is done with dependabot for “pinned dependencies”.
Since we can’t have comment in json file, I am thinking to introduce a new optional field called scm_revision_reference. This means that files like the following:
Then, on a daily basis, the “scm_revision_reference” will be automatically updates for all relevant extension files for which the upstream repository set in svm_url has been updated.
This would be nice. It would ensure that git hashes are archived without requireing extension developers to generate pull requests. Would dependabot update the files automatically or Slicer maintainers would need to merge each pull request?
Thank you for your response! As a follow up question, if I submit a PR for 5.6, will my plugin be automatically accessible through older versions like 5.4 too? Or will it only be visible to the latest stable version users?
The 5.6 branch will make it available for the latest Slicer stable (5.6.2). It will not be available in older stable release (5.6.1, 5.6.0, 5.4.0 and older). The Slicer factory build machine only builds new extension packages for the latest Slicer stable and latest Slicer preview.