package
0.0.0-20241226081621-c3f2b7517769
Repository: https://github.com/konflux-ci/integration-service.git
Documentation: pkg.go.dev

# Functions

AddIntegrationTestRerunLabel adding re-run label to snapshot.
AnnotateSnapshot sets annotation for a snapshot in defined context, return error if meeting it.
CanSnapshotBePromoted checks if the Snapshot in question can be promoted for deployment and release.
CompareSnapshots compares two Snapshots and returns boolean true if their images match exactly.
CopySnapshotLabelsAndAnnotations coppies labels and annotations from build pipelineRun or tested snapshot into regular snapshot.
FilterIntegrationTestScenariosWithContext returns a filtered list of IntegrationTestScenario from the given list of IntegrationTestScenarios compared against the given Snapshot based on individual IntegrationTestScenario contexts.
FindMatchingSnapshot tries to finds the expected Snapshot with the same set of images.
FindMatchingSnapshotComponent find the snapshot component from the given snapshot according to the name of the given component name.
GetAppStudioTestsFinishedTime finds the timestamp of tests succeeded condition.
GetComponentSourceFromComponent gets the component source from the given Component as Revision and set Component.Status.LastBuiltCommit as Component.Source.GitSource.Revision if it is defined.
GetIntegrationTestRunLabelValue returns value of the label responsible for re-running tests.
Deprecated.
GetPRGroupFromSnapshot gets the value of label test.appstudio.openshift.io/pr-group-sha and annotation from component snapshot.
No description provided by the author
GetTestSucceededCondition checks status of tests on the snapshot.
HasPRGroupProcessed checks if the pr group has been handled by snapshot adapter to avoid duplicate check, if yes, won't handle the snapshot again.
HasSnapshotRerunLabelChanged returns a boolean indicating whether the Snapshot label for re-running integration test has changed.
HasSnapshotTestAnnotationChanged returns a boolean indicating whether the Snapshot annotation has changed.
HasSnapshotTestingChangedToFinished returns a boolean indicating whether the Snapshot testing status has changed to finished.
HaveAppStudioTestsFinished checks if the AppStudio tests have finished by checking if the AppStudio Test Succeeded condition is set.
HaveAppStudioTestsSucceeded checks if the AppStudio tests have finished by checking if the AppStudio Test Succeeded condition is set.
HaveGitSource checks if snapshotComponent contains non-empty source.git field and have both url and revision fields defined.
IntegrationSnapshotChangePredicate returns a predicate which filters out all objects except snapshot is deleted and requires HasSnapshotTestingChangedToFinished for update events.
No description provided by the author
No description provided by the author
IsContextValidForSnapshot checks the context and compares it against the Snapshot to determine if it applies.
IsGroupSnapshot returns true if snapshot label 'test.appstudio.openshift.io/type' is 'group'.
IsOverrideSnapshot returns true if snapshot label 'test.appstudio.openshift.io/type' is 'override'.
IsScenarioApplicableToSnapshotsContext checks the contexts list for a given IntegrationTestScenario and compares it against the Snapshot to determine if the scenario applies to it.
IsSnapshotCreatedByPACPushEvent checks if a snapshot has label PipelineAsCodeEventTypeLabel and with push value it the label doesn't exist for some manual snapshot.
IsSnapshotCreatedBySamePACEvent checks if the two snapshot are created by the same PAC event or they don't have event type.
IsSnapshotError if the AppStudio Integration Status condition is in ErrorOcurred status.
IsSnapshotIntegrationStatusMarkedAsFinished returns true if snapshot is marked as finished.
IsSnapshotMarkedAsAddedToGlobalCandidateList returns true if snapshot's component is marked as added to global candidate list.
IsSnapshotMarkedAsAutoReleased returns true if snapshot is marked as deployed to root environments.
IsSnapshotMarkedAsFailed returns true if snapshot is marked as failed.
IsSnapshotMarkedAsInvalid returns true if snapshot is marked as failed.
IsSnapshotMarkedAsPassed returns true if snapshot is marked as passed.
IsSnapshotNotStarted checks if the AppStudio Integration Status condition is not in progress status.
IsSnapshotStatusConditionSet checks if the condition with the conditionType in the status of Snapshot has been marked as the conditionStatus and reason.
IsSnapshotValid checks if the AppStudio Integration Status condition is not invalid.
MarkSnapshotAsAddedToGlobalCandidateList updates the SnapshotAddedToGlobalCandidateListCondition for the Snapshot to true with reason 'Added'.
MarkSnapshotAsAutoReleased updates the SnapshotAutoReleasedCondition for the Snapshot to 'AutoReleased'.
MarkSnapshotAsFailed updates the AppStudio Test succeeded condition for the Snapshot to failed.
MarkSnapshotAsInvalid updates the AppStudio integration status condition for the Snapshot to invalid.
MarkSnapshotAsPassed updates the AppStudio Test succeeded condition for the Snapshot to passed.
MarkSnapshotIntegrationStatusAsFinished sets the AppStudio integration status condition for the Snapshot to Finished.
MarkSnapshotIntegrationStatusAsInProgress sets the AppStudio integration status condition for the Snapshot to In Progress.
NewSnapshot creates a new snapshot based on the supplied application and components.
NewSnapshotIntegrationTestStatusesFromSnapshot creates new SnapshotTestStatus struct from snapshot annotation.
NotifyComponentSnapshotsInGroupSnapshot annotate the msg to the given component snapshots in componentSnapshotInfos.
PrepareSnapshot prepares the Snapshot for a given application, components and the updated component (if any).
PrepareToRegisterIntegrationPipelineRunStarted is to do preparation before calling RegisterPipelineRunStarted Don't use this function for PLR re-runs.
RemoveIntegrationTestRerunLabel removes re-run label from snapshot.
No description provided by the author
No description provided by the author
No description provided by the author
SetSnapshotIntegrationStatusAsError sets the AppStudio integration status condition for the Snapshot to error.
SetSnapshotIntegrationStatusAsInvalid sets the AppStudio integration status condition for the Snapshot to invalid.
SnapshotIntegrationTestRerunTriggerPredicate returns a predicate which filters out all objects except when label for rerunning an integration test is added.
SnapshotTestAnnotationChangePredicate returns a predicate which filters out all objects except when Snapshot annotation "test.appstudio.openshift.io/status" is changed for update events.
SortSnapshots sorts the snapshots according to the snapshot annotation BuildPipelineRunStartTime.
UnmarshalJSON load data from JSON.
ValidateImageDigest checks if image url contains valid digest, return error if check fails.
WriteIntegrationTestStatusesIntoSnapshot writes data to snapshot by updating CR Data are written only when new changes are detected.

# Constants

ApplicationNameLabel contains the name of the application.
AppStudioIntegrationStatusCondition is the condition for marking the AppStudio integration status of the Snapshot.
AppStudioIntegrationStatusErrorOccured is the reason that's set when the AppStudio integration gets into an error state.
AppStudioIntegrationStatusFinished is the reason that's set when the AppStudio tests finish.
AppStudioIntegrationStatusInProgress is the reason that's set when the AppStudio tests gets into an in progress state.
AppStudioIntegrationStatusInvalid is the reason that's set when the AppStudio integration gets into an invalid state.
AppstudioLabelPrefix contains application, component, build-pipelinerun etc.
AppStudioTestSucceededCondition is the condition for marking if the AppStudio Tests succeeded for the Snapshot.
AppStudioTestSucceededConditionFailed is the reason that's set when the AppStudio tests fail.
AppStudioTestSucceededConditionSatisfied is the reason that's set when the AppStudio tests succeed.
BuildPipelineRunFinishTimeLabel contains the build PipelineRun finish time of the Snapshot.
BuildPipelineRunNameLabel contains the build PipelineRun name.
BuildPipelineRunPrefix contains the build pipeline run related labels and annotations.
BuildPipelineRunStartTime contains the start time of build pipelineRun.
CustomLabelPrefix contains the prefix applied to custom user-defined labels and annotations.
GroupSnapshotInfoAnnotation contains the component snapshot info included in group snapshot.
IntegrationTestStatusErrorGithub is the status reported to github when integration test experience error.
IntegrationTestStatusFailureGithub is the status reported to github when integration test fail.
IntegrationTestStatusInProgressGithub is the status reported to github when integration test is in progress.
the statuses needed to report to GiHub when creating check run or commit status, see doc https://docs.github.com/en/rest/guides/using-the-rest-api-to-interact-with-checks?apiVersion=2022-11-28 https://docs.github.com/en/free-pro-team@latest/rest/checks/runs?apiVersion=2022-11-28#create-a-check-runIntegrationTestStatusPendingGithub is the status reported to github when integration test is in a queue.
IntegrationTestStatusSuccessGithub is the status reported to github when integration test succeed.
LegacyIntegrationStatusCondition is the condition for marking the AppStudio integration status of the Snapshot.
LegacyTestSucceededCondition is the condition for marking if the AppStudio Tests succeeded for the Snapshot.
PipelineAsCodeEventTypeLabel is the type of event which triggered the pipelinerun in build service.
PipelineAsCodeGitHubProviderType is the git provider type for a GitHub event which triggered the pipelinerun in build service.
PipelineAsCodeGitHubProviderType is the git provider type for a GitHub event which triggered the pipelinerun in build service.
PipelineAsCodeGitProviderAnnotation is the git provider which triggered the pipelinerun in build service.
PipelineAsCodeGitProviderLabel is the git provider which triggered the pipelinerun in build service.
PipelineAsCodeGitProviderAnnotation contains the git provider attached via PaC (e.g., github, gitlab).
PipelineAsCodeGLPushType is the type of gitlab push event which triggered the pipelinerun in build service.
PipelineAsCodeInstallationIDAnnotation is the GitHub App installation ID for the git repo which triggered the pipelinerun in build service.
PipelineAsCodeMergeRequestType is the type of merge request event which triggered the pipelinerun in build service.
PipelineAsCodePullRequestAnnotation is the git repository's pull request identifier.
PipelineAsCodePullRequestType is the type of pull_request event which triggered the pipelinerun in build service.
PipelineAsCodePushType is the type of push event which triggered the pipelinerun in build service.
PipelineAsCodeRepoUrlAnnotation is the target project Repo Url.
PipelineAsCodeRepoURLAnnotation is the URL to the git repository which triggered the pipelinerun in build service.
PipelineAsCodeSHAAnnotation is the commit which triggered the pipelinerun in build service.
PipelineAsCodeSHALabel is the commit which triggered the pipelinerun in build service.
PipelineAsCodeSourceProjectIDAnnotation is the source project ID for gitlab.
PipelineAsCodeTargetBranchAnnotation is the SHA of the git revision which triggered the pipelinerun in build service.
PipelineAsCodeTargetProjectIDAnnotation is the target project ID for gitlab.
PipelineAsCodeURLOrgLabel is the organization for the git repo which triggered the pipelinerun in build service.
PipelineAsCodeURLRepositoryLabel is the git repository which triggered the pipelinerun in build service.
PipelinesAsCodePrefix contains the prefix applied to labels and annotations copied from Pipelines as Code resources.
PRGroupAnnotation contains the pr group name.
PRGroupCreationAnnotation contains the info of groupsnapshot creation.
PRGroupHashLabel contains the pr group name in sha format.
SnapshotAddedToGlobalCandidateListCondition is the condition for marking if Snapshot's component was added to the global candidate list.
SnapshotAutoReleasedCondition is the condition for marking if Snapshot was auto-released released with AppStudio.
SnapshotComponentType is the type of Snapshot which was created for a single component build.
SnapshotGitSourceRepoURLAnnotation contains URL of the git source repository (usually needed for forks).
SnapshotGroupType is the type of Snapshot which was created for pull request groups.
SnapshotIntegrationTestRun contains name of test we want to trigger run.
SnapshotLabel contains the name of the Snapshot within appstudio.
SnapshotOverrideType is the type of Snapshot which was created for override Global Candidate List.
(Deprecated) SnapshotPRLastUpdate contains timestamp of last time PR was updated.
SnapshotStatusReportAnnotation contains metadata of tests related to status reporting to git provider.
SnapshotTestScenarioLabel contains the name of the Snapshot test scenario.
SnapshotTestScenarioLabel contains json data with test results of the particular snapshot.
SnapshotTypeLabel contains the type of the Snapshot.
TestLabelPrefix contains the prefix applied to labels and annotations related to testing.

# Variables

SnapshotComponentLabel contains the name of the updated Snapshot component - it should match the pipeline label.

# Structs

ComponentSnapshotInfo contains data about the component snapshots' info in group snapshot.