Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(STONEINTG-998): support group snapshot #842

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

hongweiliu17
Copy link
Contributor

  • Create group snapshot for the component snapshots with opened PR and belonging to the same pr group once a component snasphot is created for PR
  • Set group to snapshot type to group snapshot
  • Set event-type to pull-request to group snapshot
  • Set pr-group annotation and pr-group-sha label from component snasphot to group snapshot

Maintainers will complete the following section

loader/loader.go Fixed Show fixed Hide fixed
loader/loader.go Fixed Show fixed Hide fixed
loader/loader.go Fixed Show fixed Hide fixed
loader/loader.go Fixed Show fixed Hide fixed
loader/loader.go Fixed Show fixed Hide fixed
status/reporter_github.go Fixed Show fixed Hide fixed
@codecov-commenter
Copy link

codecov-commenter commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 44.26230% with 204 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@de7f46e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
status/status.go 0.00% 84 Missing ⚠️
internal/controller/snapshot/snapshot_adapter.go 50.34% 54 Missing and 17 partials ⚠️
gitops/snapshot.go 57.62% 22 Missing and 3 partials ⚠️
loader/loader.go 62.50% 9 Missing and 9 partials ⚠️
loader/loader_mock.go 60.00% 2 Missing and 2 partials ⚠️
git/github/github.go 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #842   +/-   ##
=======================================
  Coverage        ?   69.16%           
=======================================
  Files           ?       43           
  Lines           ?     4440           
  Branches        ?        0           
=======================================
  Hits            ?     3071           
  Misses          ?     1051           
  Partials        ?      318           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hongweiliu17 hongweiliu17 force-pushed the STONEINTG-998 branch 4 times, most recently from fe69e69 to 3a7de64 Compare August 16, 2024 14:02
internal/controller/snapshot/snapshot_adapter.go Outdated Show resolved Hide resolved
internal/controller/snapshot/snapshot_adapter.go Outdated Show resolved Hide resolved
internal/controller/snapshot/snapshot_adapter.go Outdated Show resolved Hide resolved
internal/controller/snapshot/snapshot_adapter.go Outdated Show resolved Hide resolved
internal/controller/snapshot/snapshot_adapter.go Outdated Show resolved Hide resolved
internal/controller/snapshot/snapshot_adapter.go Outdated Show resolved Hide resolved
@dheerajodha
Copy link
Member

(please ignore this comment, testing something else)
/retest

@dirgim
Copy link
Collaborator

dirgim commented Aug 30, 2024

/retest-required

@hongweiliu17
Copy link
Contributor Author

Tested component snapshot from github, group snapshot is created as below:

{
    "apiVersion": "appstudio.redhat.com/v1alpha1",
    "kind": "Snapshot",
    "metadata": {
        "annotations": {
            "test.appstudio.openshift.io/create-groupsnapshot-status": "Failed to get PR group hash from snapshot default/app-8969-vlnsw",
            "test.appstudio.openshift.io/group-test-info": "[{\"namespace\":\"default\",\"component\":\"devfile-sample-java-springboot-basic-8969\",\"buildPipelineRun\":\"build-plr-java-qjfxz\",\"snapshot\":\"app-8969-bbn7d\"},{\"namespace\":\"default\",\"component\":\"devfile-sample-go-basic-8969\",\"buildPipelineRun\":\"build-plr-go-jmsjq\",\"snapshot\":\"app-8969-kzq2l\"}]",
            "test.appstudio.openshift.io/pr-group": "test-1"
        },
        "creationTimestamp": "2024-08-30T13:41:36Z",
        "generateName": "app-8969-",
        "generation": 1,
        "labels": {
            "appstudio.openshift.io/application": "app-8969",
            "pac.test.appstudio.openshift.io/event-type": "pull_request",
            "test.appstudio.openshift.io/type": "group"
        },
        "name": "app-8969-vlnsw",
        "namespace": "default",
        "ownerReferences": [
            {
                "apiVersion": "appstudio.redhat.com/v1alpha1",
                "blockOwnerDeletion": true,
                "controller": true,
                "kind": "Application",
                "name": "app-8969",
                "uid": "0a33d99d-dfde-47bb-9cbd-78445bb71ce0"
            }
        ],
        "resourceVersion": "360360096",
        "uid": "2f5ee177-d98f-4507-a5c0-435eaa3a64ac"
    },
    "spec": {
        "application": "app-8969",
        "artifacts": {},
        "components": [
            {
                "containerImage": "quay.io/redhat-appstudio/sample-image@sha256:a785a38ed1decd9bb6d3f677320e9ba48e19621edbf070cd826d102db559fe12",
                "name": "devfile-sample-java-springboot-basic-8969",
                "source": {
                    "git": {
                        "revision": "sha256:ba81b79f5640e1833df8090b3100cc0b61339540ea8cdf3c6ffabaa761c0aa84",
                        "url": "git@github.com:redhat-appstudio/integration-service.git\n"
                    }
                }
            },
            {
                "containerImage": "quay.io/redhat-appstudio/sample-image@sha256:6704761b3cbf8260c556c3e41399ab8bcdf0b51a98935efc0405bd9ca098de87",
                "name": "devfile-sample-go-basic-8969",
                "source": {
                    "git": {
                        "revision": "sha256:53c46b267f9b06713ef3e67e6e31929c824a6ca30bfff47ba1f9a48552b3308f",
                        "url": "git@github.com:redhat-appstudio/integration-service.git\n"
                    }
                }
            },
            {
                "containerImage": "quay.io/redhat-appstudio/sample-image@sha256:ae0126bcb129ca1a72eda605c18598a5845669f87cc6de6324efc23dc20c1837",
                "name": "component-sample",
                "source": {
                    "git": {
                        "url": "https://github.com/redhat-appstudio-qe/hacbs-test-project"
                    }
                }
            }
        ]
    },
    "status": {
        "conditions": [
            {
                "lastTransitionTime": "2024-08-30T13:41:36Z",
                "message": "No required IntegrationTestScenarios found, skipped testing",
                "reason": "Passed",
                "status": "True",
                "type": "AppStudioTestSucceeded"
            }
        ]
    }
}

@hongweiliu17 hongweiliu17 force-pushed the STONEINTG-998 branch 2 times, most recently from f62f3cd to bbd8861 Compare September 2, 2024 10:30
@hongweiliu17
Copy link
Contributor Author

/test integration-service-e2e

@hongweiliu17
Copy link
Contributor Author

/test integration-service-e2e

1 similar comment
@hongweiliu17
Copy link
Contributor Author

/test integration-service-e2e

Copy link
Collaborator

@dirgim dirgim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci openshift-ci bot added the lgtm label Sep 3, 2024
@kasemAlem
Copy link
Contributor

/test integration-service-e2e

* Create group snapshot for the component snapshots with opened PR
  and belonging to the same pr group once a component snasphot is
  created for PR
* Set group to snapshot type to group snapshot
* Set event-type to pull-request to group snapshot
* Copy pr-group annotation and pr-group-sha label from component
  snasphot to group snapshot

Signed-off-by: Hongwei Liu <hongliu@redhat.com>
Copy link

openshift-ci bot commented Sep 4, 2024

New changes are detected. LGTM label has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants