types module (v1)
API provided in types.py module. This module contains classes for easy interaction. You can also use them as type hints in your code.
Usage in package API
from git_system_follower.develop.api.types import (
Parameters, System, ExtraParam, ExtraParams,
CICDVariable, CICDVariables
)
Note
For backward compatibility, v1 packages can import from the legacy unversioned path
(git_system_follower.develop.api.*). The explicit versioned path
(git_system_follower.develop.api.v1.*) is equivalent and is preferred for new packages.
Classes description
Parameters class
@dataclass(frozen=True)
class Parameters:
system: System
workdir: Path
extras: ExtraParams
cicd_variables: CICDVariables
all_cicd_variables: CICDVariables
used_template: str
Warning
This class is only used to transfer information. Don't create your own instances
Fields
| Name | Type | Description |
|---|---|---|
system |
System |
system information |
workdir |
Path from pathlib library |
current work directory |
extras |
ExtraParams |
extra parameters which have been passed in git-system-follower |
cicd_variables |
CICDVariables |
CI/CD variables that were created by previous gear version |
all_cicd_variables |
CICDVariables |
all CI/CD variables that exist in repository |
used_template |
str |
last used template. If used_template=None then no template has been used. If template has been deleted, it will be None |
The workdir path can be used to maintain file integrity by allowing preemptive cleanup of existing files before new versions are installed. This is critical for scenarios where gear install/updates must guarantee that only the latest files are present in the system.
System class
System information about instance in which gear installed/uninstalled
Warning
This class is only used to transfer information. Don't create your own instances
Fields
| Name | Type | Description |
|---|---|---|
host_domain |
str |
host domain, e.g. your.company.com |
ExtraParam class
Extra parameter information
Fields
| Name | Type | Description |
|---|---|---|
name |
str |
extra parameter name |
value |
str |
extra parameter value |
masked |
bool |
whether to mask a extra parameter in logs |
managed_by |
str |
managed by gsf or external like CI token |
ExtraParams class
Extra parameters which have been passed in git-system-follower as --extra <name> <value> <masked/no-masked>
Extra external parameters which have been passed in git-system-follower as --extra-external <name> <value> <masked/no-masked>
This is dict where key is parameter name, value is ExtraParam
CICDVariable class
CI/CD variable information
Fields
| Name | Type | Description |
|---|---|---|
name |
str |
CI/CD variable name |
value |
str |
CI/CD variable value |
env |
str |
GitLab environment (see GitLab Environments documentation) |
masked |
bool |
whether to mask a CI/CD variable in logs and in GitLab |
CICDVariables class
CI/CD variables information
This is dict where key is CI/CD variable name, value is CICDVariable