Getting started with Red Hat Developer Hub
Abstract
Preface
As a developer, you can use Red Hat Developer Hub to experience a streamlined development environment. Red Hat Developer Hub is driven by a centralized software catalog, providing efficiency to your microservices and infrastructure. It enables your product team to deliver quality code without any compromises.
Chapter 1. Overview of Red Hat Developer Hub
Red Hat Developer Hub (Developer Hub) serves as an open developer platform designed for building developer portals and is based on the backstage project. Using Developer Hub, the engineering teams can access a unified platform that streamlines the development process and provides a variety of tools and resources to build high-quality software efficiently.
The goal of Developer Hub is to address the difficulties associated with creating and sustaining developer portals using:
- A centralized dashboard to view all available developer tools and resources to increase productivity
- Self-service capabilities, along with guardrails, for cloud-native application development that complies with enterprise-class best practices
- Proper security and governance for all developers across the enterprise
The Red Hat Developer Hub simplifies decision-making by providing a developer experience that presents a selection of internally approved tools, programming languages, and various developer resources within a self-managed portal. This approach contributes to the acceleration of application development and the maintenance of code quality, all while fostering innovation.
Chapter 2. Sizing requirements for Red Hat Developer Hub
Scalability of Red Hat Developer Hub requires significant resource allocation. The following table lists the sizing requirements for installing and running Red Hat Developer Hub, including Developer Hub application, database components, and Operator.
Table 2.1. Recommended sizing for running Red Hat Developer Hub
Components | Red Hat Developer Hub application | Red Hat Developer Hub database | Red Hat Developer Hub Operator |
---|---|---|---|
Central Processing Unit (CPU) |
4 vCPU |
2 vCPU |
1 vCPU |
Memory |
16 GB |
8 GB |
1500 Mi |
Storage size |
2 GB |
20 GB |
50 Mi |
Replicas |
2 or more |
3 or more |
1 or more |
Chapter 3. Supported configurations for Red Hat Developer Hub
This section describes the configurations that are required to access the Red Hat Developer Hub, including:
- Custom applications configuration
- Source control configuration for Developer Hub Catalog
Chapter 4. Bulk importing GitHub repositories
These features are for Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend using them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information on Red Hat Technology Preview features, see Technology Preview Features Scope.
Red Hat Developer Hub can automate GitHub repositories onboarding and track their import status.
4.1. Enabling and giving access to the Bulk Import feature
You can enable the Bulk Import feature for users and give them the necessary permissions to access it.
Prerequisites
- You have configured GitHub integration.
Procedure
The Bulk Import plugins are installed but disabled by default. To enable the
./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import-backend-dynamic
and./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import
plugins, edit yourdynamic-plugins.yaml
with the following content:dynamic-plugins.yaml
fragmentplugins: - package: ./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import-backend-dynamic disabled: false - package: ./dynamic-plugins/dist/janus-idp-backstage-plugin-bulk-import disabled: false
Configure the required
bulk.import
RBAC permission for the users who are not administrators as follows:rbac-policy.csv
fragmentp, role:default/bulk-import, bulk.import, use, allow g, user:default/<your_user>, role:default/bulk-import
Note that only Developer Hub administrators or users with the
bulk.import
permission can use the Bulk Import feature. See Permission policies in Red Hat Developer Hub.
Verification
- The sidebar displays a Bulk Import option.
- The Bulk Import page shows a list of Added Repositories.
4.2. Importing multiple GitHub repositories
In Red Hat Developer Hub, you can select your GitHub repositories and automate their onboarding to the Developer Hub catalog.
Prerequisites
Procedure
- Click Bulk Import in the left sidebar.
Click the Add button in the top-right corner to see the list of all repositories accessible from the configured GitHub integrations.
-
From the Repositories view, you can select any repository, or search for any accessible repositories. For each repository selected, a
catalog-info.yaml
is generated. - From the Organizations view, you can select any organization by clicking Select in the third column. This option allows you to select one or more repositories from the selected organization.
-
From the Repositories view, you can select any repository, or search for any accessible repositories. For each repository selected, a
Click Preview file to view or edit the details of the pull request for each repository.
-
Review the pull request description and the
catalog-info.yaml
file content. -
Optional: when the repository has a
.github/CODEOWNERS
file, you can select the Use CODEOWNERS file as Entity Owner checkbox to use it, rather than having thecontent-info.yaml
contain a specific entity owner. - Click Save.
-
Review the pull request description and the
Click Create pull requests. At this point, a set of dry-run checks runs against the selected repositories to ensure they meet the requirements for import, such as:
-
Verifying that there is no entity in the Developer Hub catalog with the name specified in the repository
catalog-info.yaml
- Verifying that the repository is not empty
Verifying that the repository contains a
.github/CODEOWNERS
file if the Use CODEOWNERS file as Entity Owner checkbox is selected for that repository- If any errors occur, the pull requests are not created, and you see a Failed to create PR error message detailing the issues. To view more details about the reasons, click Edit.
- If there are no errors, the pull requests are created, and you are redirected to the list of added repositories.
-
Verifying that there is no entity in the Developer Hub catalog with the name specified in the repository
-
Review and merge each pull request that creates a
catalog-info.yml
file.
Verification
- The Added repositories list displays the repositories you imported, each with an appropriate status: either Waiting for approval or Added.
-
For each Waiting for approval import job listed, there is a corresponding pull request adding the
catalog-info.yaml
file in the corresponding repository.
4.3. Managing the added repositories
You can oversee and manage the repositories that are imported to the Developer Hub.
Prerequisites
- You have imported GitHub repositories.
Procedure
Click Bulk Import in the left sidebar to display all the current repositories that are being tracked as Import jobs, along with their status.
- Added
-
The repository is added to the Developer Hub catalog after the import pull request is merged or if the repository already contained a
catalog-info.yaml
file during the bulk import. Note that it may take a few minutes for the entities to be available in the catalog. - Waiting for approval
There is an open pull request adding a
catalog-info.yaml
file to the repository. You can:- Click the pencil icon on the right to see details about the pull request or edit the pull request content right from Developer Hub.
- Delete the Import job, this action closes the import PR as well.
- To transition the Import job to the Added state, merge the import pull request from the Git repository.
- Empty
-
Developer Hub is unable to determine the import job status because the repository is imported from other sources but does not have a
catalog-info.yaml
file and lacks any import pull request adding it.
- After an import pull request is merged, the import status is marked as Added in the list of Added Repositories, but it might take a few seconds for the corresponding entities to appear in the Developer Hub Catalog.
A location added through other sources (like statically in an
app-config.yaml
file, dynamically when enabling GitHub discovery, or registered manually using the "Register an existing component" page) might show up in the Bulk Import list of Added Repositories if the following conditions are met:- The target repository is accessible from the configured GitHub integrations.
-
The location URL points to a
catalog-info.yaml
file at the root of the repository default branch.
4.4. Understanding the Bulk Import audit Logs
The Bulk Import backend plugin adds the following events to the Developer Hub audit logs. See Audit Logs in Red Hat Developer Hub for more information on how to configure and view audit logs.
Bulk Import Events:
BulkImportUnknownEndpoint
- Tracks requests to unknown endpoints.
BulkImportPing
-
Tracks
GET
requests to the/ping
endpoint, which allows us to make sure the bulk import backend is up and running. BulkImportFindAllOrganizations
-
Tracks
GET
requests to the/organizations
endpoint, which returns the list of organizations accessible from all configured GitHub Integrations. BulkImportFindRepositoriesByOrganization
-
Tracks
GET
requests to the/organizations/:orgName/repositories
endpoint, which returns the list of repositories for the specified organization (accessible from any of the configured GitHub Integrations). BulkImportFindAllRepositories
-
Tracks GET requests to the
/repositories
endpoint, which returns the list of repositories accessible from all configured GitHub Integrations. BulkImportFindAllImports
-
Tracks
GET
requests to the/imports
endpoint, which returns the list of existing import jobs along with their statuses. BulkImportCreateImportJobs
-
Tracks
POST
requests to the/imports
endpoint, which allows to submit requests to bulk-import one or many repositories into the Developer Hub catalog, by eventually creating import pull requests in the target repositories. BulkImportFindImportStatusByRepo
-
Tracks
GET
requests to the/import/by-repo
endpoint, which fetches details about the import job for the specified repository. BulkImportDeleteImportByRepo
-
Tracks
DELETE
requests to the/import/by-repo
endpoint, which deletes any existing import job for the specified repository, by closing any open import pull request that could have been created.
Example bulk import audit logs
{ "actor": { "actorId": "user:default/myuser", "hostname": "localhost", "ip": "::1", "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" }, "eventName": "BulkImportFindAllOrganizations", "isAuditLog": true, "level": "info", "message": "'get /organizations' endpoint hit by user:default/myuser", "meta": {}, "plugin": "bulk-import", "request": { "body": {}, "method": "GET", "params": {}, "query": { "pagePerIntegration": "1", "sizePerIntegration": "5" }, "url": "/api/bulk-import/organizations?pagePerIntegration=1&sizePerIntegration=5" }, "response": { "status": 200 }, "service": "backstage", "stage": "completion", "status": "succeeded", "timestamp": "2024-08-26 16:41:02" }
Chapter 5. ServiceNow Custom actions in Red Hat Developer Hub
These features are for Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend using them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information on Red Hat Technology Preview features, see Technology Preview Features Scope.
In Red Hat Developer Hub, you can access ServiceNow custom actions (custom actions) for fetching and registering resources in the catalog.
The custom actions in Developer Hub enable you to facilitate and automate the management of records. Using the custom actions, you can perform the following actions:
- Create, update, or delete a record
- Retrieve information about a single record or multiple records
5.1. Enabling ServiceNow custom actions plugin in Red Hat Developer Hub
In Red Hat Developer Hub, the ServiceNow custom actions are provided as a pre-loaded plugin, which is disabled by default. You can enable the custom actions plugin using the following procedure.
Prerequisites
- Red Hat Developer Hub is installed and running. For more information about installing the Developer Hub, see Installing Red Hat Developer Hub on OpenShift Container Platform with the Helm chart.
- You have created a project in the Developer Hub.
Procedure
To activate the custom actions plugin, add a
package
with plugin name and update thedisabled
field in your Helm Chart as follows:global: dynamic: includes: - dynamic-plugins.default.yaml plugins: - package: ./dynamic-plugins/dist/janus-idp-backstage-scaffolder-backend-module-servicenow-dynamic disabled: false
NoteThe default configuration for a plugin is extracted from the
dynamic-plugins.default.yaml
file, however, you can use apluginConfig
entry to override the default configuration.Set the following variables in the Helm Chart to access the custom actions:
servicenow: # The base url of the ServiceNow instance. baseUrl: ${SERVICENOW_BASE_URL} # The username to use for authentication. username: ${SERVICENOW_USERNAME} # The password to use for authentication. password: ${SERVICENOW_PASSWORD}
5.2. Supported ServiceNow custom actions in Red Hat Developer Hub
The ServiceNow custom actions enable you to manage records in the Red Hat Developer Hub. The custom actions support the following HTTP methods for API requests:
-
GET
: Retrieves specified information from a specified resource endpoint -
POST
: Creates or updates a resource -
PUT
: Modify a resource -
PATCH
: Updates a resource -
DELETE
: Deletes a resource
5.2.1. ServiceNow custom actions
- [GET] servicenow:now:table:retrieveRecord
Retrieves information of a specified record from a table in the Developer Hub.
Table 5.1. Input parameters
Name Type Requirement Description tableName
string
Required
Name of the table to retrieve the record from
sysId
string
Required
Unique identifier of the record to retrieve
sysparmDisplayValue
enum("true", "false", "all")
Optional
Returns field display values such as
true
, actual values asfalse
, or both. The default value isfalse
.sysparmExcludeReferenceLink
boolean
Optional
Set as
true
to exclude Table API links for reference fields. The default value isfalse
.sysparmFields
string[]
Optional
Array of fields to return in the response
sysparmView
string
Optional
Renders the response according to the specified UI view. You can override this parameter using
sysparm_fields
.sysparmQueryNoDomain
boolean
Optional
Set as
true
to access data across domains if authorized. The default value isfalse
.Table 5.2. Output parameters
Name Type Description result
Record<PropertyKey, unknown>
The response body of the request
- [GET] servicenow:now:table:retrieveRecords
Retrieves information about multiple records from a table in the Developer Hub.
Table 5.3. Input parameters
Name Type Requirement Description tableName
string
Required
Name of the table to retrieve the records from
sysparamQuery
string
Optional
Encoded query string used to filter the results
sysparmDisplayValue
enum("true", "false", "all")
Optional
Returns field display values such as
true
, actual values asfalse
, or both. The default value isfalse
.sysparmExcludeReferenceLink
boolean
Optional
Set as
true
to exclude Table API links for reference fields. The default value isfalse
.sysparmSuppressPaginationHeader
boolean
Optional
Set as
true
to suppress pagination header. The default value isfalse
.sysparmFields
string[]
Optional
Array of fields to return in the response
sysparmLimit
int
Optional
Maximum number of results returned per page. The default value is
10,000
.sysparmView
string
Optional
Renders the response according to the specified UI view. You can override this parameter using
sysparm_fields
.sysparmQueryCategory
string
Optional
Name of the query category to use for queries
sysparmQueryNoDomain
boolean
Optional
Set as
true
to access data across domains if authorized. The default value isfalse
.sysparmNoCount
boolean
Optional
Does not execute a select count(*) on the table. The default value is
false
.Table 5.4. Output parameters
Name Type Description result
Record<PropertyKey, unknown>
The response body of the request
- [POST] servicenow:now:table:createRecord
Creates a record in a table in the Developer Hub.
Table 5.5. Input parameters
Name Type Requirement Description tableName
string
Required
Name of the table to save the record in
requestBody
Record<PropertyKey, unknown>
Optional
Field name and associated value for each parameter to define in the specified record
sysparmDisplayValue
enum("true", "false", "all")
Optional
Returns field display values such as
true
, actual values asfalse
, or both. The default value isfalse
.sysparmExcludeReferenceLink
boolean
Optional
Set as
true
to exclude Table API links for reference fields. The default value isfalse
.sysparmFields
string[]
Optional
Array of fields to return in the response
sysparmInputDisplayValue
boolean
Optional
Set field values using their display value such as
true
or actual value asfalse
. The default value isfalse
.sysparmSuppressAutoSysField
boolean
Optional
Set as
true
to suppress auto-generation of system fields. The default value isfalse
.sysparmView
string
Optional
Renders the response according to the specified UI view. You can override this parameter using
sysparm_fields
.Table 5.6. Output parameters
Name Type Description result
Record<PropertyKey, unknown>
The response body of the request
- [PUT] servicenow:now:table:modifyRecord
Modifies a record in a table in the Developer Hub.
Table 5.7. Input parameters
Name Type Requirement Description tableName
string
Required
Name of the table to modify the record from
sysId
string
Required
Unique identifier of the record to modify
requestBody
Record<PropertyKey, unknown>
Optional
Field name and associated value for each parameter to define in the specified record
sysparmDisplayValue
enum("true", "false", "all")
Optional
Returns field display values such as
true
, actual values asfalse
, or both. The default value isfalse
.sysparmExcludeReferenceLink
boolean
Optional
Set as
true
to exclude Table API links for reference fields. The default value isfalse
.sysparmFields
string[]
Optional
Array of fields to return in the response
sysparmInputDisplayValue
boolean
Optional
Set field values using their display value such as
true
or actual value asfalse
. The default value isfalse
.sysparmSuppressAutoSysField
boolean
Optional
Set as
true
to suppress auto-generation of system fields. The default value isfalse
.sysparmView
string
Optional
Renders the response according to the specified UI view. You can override this parameter using
sysparm_fields
.sysparmQueryNoDomain
boolean
Optional
Set as
true
to access data across domains if authorized. The default value isfalse
.Table 5.8. Output parameters
Name Type Description result
Record<PropertyKey, unknown>
The response body of the request
- [PATCH] servicenow:now:table:updateRecord
Updates a record in a table in the Developer Hub.
Table 5.9. Input parameters
Name Type Requirement Description tableName
string
Required
Name of the table to update the record in
sysId
string
Required
Unique identifier of the record to update
requestBody
Record<PropertyKey, unknown>
Optional
Field name and associated value for each parameter to define in the specified record
sysparmDisplayValue
enum("true", "false", "all")
Optional
Returns field display values such as
true
, actual values asfalse
, or both. The default value isfalse
.sysparmExcludeReferenceLink
boolean
Optional
Set as
true
to exclude Table API links for reference fields. The default value isfalse
.sysparmFields
string[]
Optional
Array of fields to return in the response
sysparmInputDisplayValue
boolean
Optional
Set field values using their display value such as
true
or actual value asfalse
. The default value isfalse
.sysparmSuppressAutoSysField
boolean
Optional
Set as
true
to suppress auto-generation of system fields. The default value isfalse
.sysparmView
string
Optional
Renders the response according to the specified UI view. You can override this parameter using
sysparm_fields
.sysparmQueryNoDomain
boolean
Optional
Set as
true
to access data across domains if authorized. The default value isfalse
.Table 5.10. Output parameters
Name Type Description result
Record<PropertyKey, unknown>
The response body of the request
- [DELETE] servicenow:now:table:deleteRecord
Deletes a record from a table in the Developer Hub.
Table 5.11. Input parameters
Name Type Requirement Description tableName
string
Required
Name of the table to delete the record from
sysId
string
Required
Unique identifier of the record to delete
sysparmQueryNoDomain
boolean
Optional
Set as
true
to access data across domains if authorized. The default value isfalse
.