rc/source-control

Definition · Catalog README · Source

Use this extension when your workload works with a Git repository while it runs, for example a build tool that clones code, or a bot that pushes changes.

In a Condition, you say which Git host the workload uses, and what it does with the repository: clone, fetch, pull or push. The platform then gives the workload access that allows exactly these actions. Right now the only host is GitHub.

Documentation

This experimental extension describes Git repository access required by a workload such as a development container or CI job. Repository credentials and concrete repository locations remain target-environment configuration and are not embedded in the Profile.

The first immutable candidate release is 0.1.0.

Example Condition:

- name: application-source
  kind: rc.source_control
  interface:
    type: git
    provider: github
    access:
      - fetch
      - push

Packages

Install the package for your language to declare this extension's Conditions from your code.

Go

Package
runtimeconditions.io/x/rc/source
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

go get runtimeconditions.io/x/rc/source@v0.2.0

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.source_control · git: Access to a repository through Git.

source.Git is the interface of a rc.source_control Condition.

Field Type Required Description
Access Access yes What your workload does with the repository. List every action that it needs. clone, fetch, pull or push. List at least one, each one once.
Values:
clone: Make a copy of the repository.
fetch: Download new changes, without changing the local files.
pull: Download new changes and add them to the local files.
push: Send local changes back to the repository.
Provider Provider yes The service that hosts the repository. Right now this is always github. Always github.
Values:
github: The repository is on GitHub.

RcSourceControl

source.RcSourceControl declares a rc.source_control Condition.

Example: a build tool that clones a repository on GitHub and fetches new changes.

source.RcSourceControl(
	source.Git{
		Access: source.Access{
			source.AccessItemClone,
			source.AccessItemFetch,
		},
		Provider: source.ProviderGithub,
	},
)

The full API, with every type, field and constant documented, is in the Go package documentation.

Python

Package
runtimeconditions-source-control
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

pip install runtimeconditions-source-control

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.source_control · git: Access to a repository through Git.

Git is the interface of a rc.source_control Condition.

Field Type Required Description
access Access yes What your workload does with the repository. List every action that it needs. clone, fetch, pull or push. List at least one, each one once.
Values:
clone: Make a copy of the repository.
fetch: Download new changes, without changing the local files.
pull: Download new changes and add them to the local files.
push: Send local changes back to the repository.
provider Provider yes The service that hosts the repository. Right now this is always github. Always github.
Values:
github: The repository is on GitHub.

rc_source_control

rc_source_control declares a rc.source_control Condition.

Example: a build tool that clones a repository on GitHub and fetches new changes.

from runtimeconditions_source_control import (
    AccessItem,
    Git,
    Provider,
    rc_source_control,
)

rc_source_control(
    Git(access=[AccessItem.CLONE, AccessItem.FETCH], provider=Provider.GITHUB),
)

Every class, field and enum member is documented in the package's docstrings.

TypeScript

Package
@runtimeconditions/source-control
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

npm install @runtimeconditions/source-control

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.source_control · git: Access to a repository through Git.

Git is the interface of a rc.source_control Condition.

Field Type Required Description
access Access yes What your workload does with the repository. List every action that it needs. clone, fetch, pull or push. List at least one, each one once.
Values:
clone: Make a copy of the repository.
fetch: Download new changes, without changing the local files.
pull: Download new changes and add them to the local files.
push: Send local changes back to the repository.
provider Provider yes The service that hosts the repository. Right now this is always github. Always github.
Values:
github: The repository is on GitHub.

rcSourceControl

rcSourceControl declares a rc.source_control Condition.

Example: a build tool that clones a repository on GitHub and fetches new changes.

import { AccessItem, Git, Provider, rcSourceControl } from "@runtimeconditions/source-control";

rcSourceControl(
  new Git({ access: [AccessItem.Clone, AccessItem.Fetch], provider: Provider.Github }),
);

Every class, field and enum member is documented in the package's type declarations.

Java

Package
io.runtimeconditions.bindings:runtimeconditions-source-control
Version
0.2.0 Not published yet

This package version is generated but not published to its registry yet.

<dependency>
  <groupId>io.runtimeconditions.bindings</groupId>
  <artifactId>runtimeconditions-source-control</artifactId>
  <version>0.2.0</version>
</dependency>

Conditions

Every Condition part this package defines, with the fields you can set. Select a line to open it.

rc.source_control · git: Access to a repository through Git.

Git is the interface of a rc.source_control Condition.

Field Type Required Description
access Access yes What your workload does with the repository. List every action that it needs. clone, fetch, pull or push. List at least one, each one once.
Values:
clone: Make a copy of the repository.
fetch: Download new changes, without changing the local files.
pull: Download new changes and add them to the local files.
push: Send local changes back to the repository.
provider Provider yes The service that hosts the repository. Right now this is always github. Always github.
Values:
github: The repository is on GitHub.

Bindings.rcSourceControl

Bindings.rcSourceControl declares a rc.source_control Condition.

Example: a build tool that clones a repository on GitHub and fetches new changes.

import io.runtimeconditions.bindings.sourcecontrol.Access;
import io.runtimeconditions.bindings.sourcecontrol.AccessItem;
import io.runtimeconditions.bindings.sourcecontrol.Bindings;
import io.runtimeconditions.bindings.sourcecontrol.Git;
import io.runtimeconditions.bindings.sourcecontrol.Provider;
import java.util.List;

Bindings.rcSourceControl(
    new Git(new Access(List.of(AccessItem.CLONE, AccessItem.FETCH)), Provider.GITHUB));

Every record, component and enum constant is documented in the Javadoc.

Kinds

rc.source_control

Your workload needs access to a Git repository.

Example: a build tool that clones a repository on GitHub and fetches new changes.

kind: rc.source_control
interface:
  type: git
  provider: github
  access: [clone, fetch]

Interface types

Interface types

git rc.source_control

Access to a repository through Git.

Example: a bot that pulls the latest code, changes files and pushes the changes back to GitHub.

kind: rc.source_control
interface:
  type: git
  provider: github
  access: [pull, push]

Fields

interface.provider

The service that hosts the repository. Right now this is always github.

interface.access

What your workload does with the repository. List every action that it needs.

Allowed values for interface.provider
ValueDescription
githubThe repository is on GitHub.
Allowed values for interface.access[]
ValueDescription
cloneMake a copy of the repository.
fetchDownload new changes, without changing the local files.
pullDownload new changes and add them to the local files.
pushSend local changes back to the repository.