Prerequisites for creating a custom extension
Overview
A custom extension that you publish on CAST Extend must have its source code and documentation stored in a public GitHub repository in the CAST-Extend organization, a licence, and freely available documentation. This page explains how to set these up, and lists tips that apply to every custom extension.
These prerequisites apply to extensions you want to share. To use an extension only in your own installation, see Deploy custom extensions.
GitHub account and organization membership
You need a public GitHub account. Your CAST Extend login is not linked to GitHub, so create a GitHub account at github.com/signup if you do not already have one. You can reuse your CAST Extend credentials, but this is not required.
You also need to be a member of the CAST-Extend organization on GitHub, with the privilege to create repositories. Contact CAST Support to be added to the organization, then click the link in the confirmation email that GitHub sends you.
Step 1 - Create the repository
- In the CAST-Extend organization , create a new repository.
- Set Repository name to the id of your extension, for example
com.castsoftware.uc.nameoftheextension. See Contributor types. - Set the visibility to Public.
- Select the option to add a README file.
- Choose a licence. CAST recommends the GNU Lesser General Public License v3.0.
- Click Create repository.
Step 2 - Add a licence
A licence is mandatory. If you did not choose one when creating the repository:
- On the main page of the repository, add a new file named
LICENSEorLICENSE.md. - Click Choose a license template and select GNU Lesser General Public License v3.0.
- Commit the file to the default branch.
In the licenseUrl element of the description file, a User Community extension references the User Community extension licence on CAST Extend: https://extend.castsoftware.com/api/package/license/uc.
Step 3 - Upload the source code
Commit the source code of your extension to the repository: the extension folder, its plugin.nuspec file and any scripts used to build or test it.
Step 4 - Publish the documentation
Every published extension must have documentation that is freely available on the internet. CAST recommends using the wiki of your GitHub repository:
- In the repository, open the Wiki tab and create a new page.
- Give the page a meaningful title.
- Write the documentation, using the CAST-Extend documentation template as a model.
- Reference the page in the
projectUrlelement of the description file.
The documentation must cover:
- what the extension does, the situations it applies to, the results to expect and how these results affect the rest of the analysis
- the CAST releases the extension is compatible with
- the versions of the technologies or frameworks it supports, and the types of project it handles
- the objects, links and projects it creates
- any new metrics and quality rules it provides
- its known limitations
Step 5 - Add an icon
An icon is optional. It represents your extension on CAST Extend and in CAST Imaging.
- Prepare an icon in PNG format, 260 x 260 pixels, with a transparent background.
- Commit the PNG file to your repository.
- Open the file on GitHub and copy its raw URL. It has the form
https://raw.githubusercontent.com/CAST-Extend/<repository>/<branch>/<file>.png. - Reference this URL in the
iconUrlelement of the description file:
<iconUrl>https://raw.githubusercontent.com/CAST-Extend/com.castsoftware.uc.nameoftheextension/main/icon.png</iconUrl>
The icon is displayed automatically when the extension is published.
Tips for every custom extension
- Reserve IDs before you write the extension. If your extension saves objects or properties to the analysis schema, or creates quality rules, it needs IDs from a reserved range. See Reserve ID ranges.
- Do not hard-code database user names in SQL scripts. If your extension runs SQL scripts, do not hard-code the
operatorandguestuser names. Some CAST Storage Service and PostgreSQL instances do not contain these users, and the scripts then fail during installation or upgrade. - Use lowercase in the extension id. CAST Extend rejects an extension whose id contains an uppercase character.