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

fix(RELEASE-1441): remove rsc from being managed #669

Closed
wants to merge 1 commit into from

Conversation

scoheb
Copy link
Collaborator

@scoheb scoheb commented Feb 10, 2025

  • the rsc needs to managed outside of the release service so that clusters can have a specific version for testing.
  • A version can be deployed and managed by ArgoCD via infra-deployments for a specific cluster

@scoheb scoheb requested a review from a team as a code owner February 10, 2025 20:21
Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.81%. Comparing base (f1cc9bd) to head (22cd46b).
Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #669      +/-   ##
==========================================
- Coverage   79.23%   78.81%   -0.42%     
==========================================
  Files          28       28              
  Lines        2283     2795     +512     
==========================================
+ Hits         1809     2203     +394     
- Misses        389      489     +100     
- Partials       85      103      +18     

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

@scoheb scoheb force-pushed the remove-rsc branch 2 times, most recently from 2c94de5 to 72ea46d Compare February 11, 2025 00:16
@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

/retest

@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

/retest

3 similar comments
@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

/retest

@jinqi7
Copy link
Contributor

jinqi7 commented Feb 11, 2025

/retest

@jinqi7
Copy link
Contributor

jinqi7 commented Feb 11, 2025

/retest

@@ -90,15 +90,24 @@ func (a *adapter) EnsureConfigIsLoaded() (controller.OperationResult, error) {
}

var err error
a.logger.Info("Getting Release Service Config")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't have a general strategy towards logging yet, but this particular line would be very noisy as it would be shown every time a resource is reconciled. If we have 1000 releases per day, this line will be showed a minimum of 3000 times...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed logging

}

a.logger.Info("Release Service Config Loaded")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Following my previous comment, this line would be shown many times. Maybe better to remove it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed logging

a.releaseServiceConfig = a.getEmptyReleaseServiceConfig(namespace)
patch := client.MergeFrom(a.releaseServiceConfig.DeepCopy())
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no need to persist it. If we really want to persist it maybe that should be done in a different place (whenever the manager is created and not per reconciliation).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to persist it. The release pipelines want to do a oc get RSC/release-service-config in collect-data

Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR says it is moving the RSC to being managed in infra-deployments instead of here. So, we are still creating a CR per env. Why do we now need to create it in the adapter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed persistance

@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

still getting Error from server (NotFound): releaseserviceconfigs.appstudio.redhat.com "release-service-config" not found

Copy link
Collaborator

@johnbieren johnbieren left a comment

Choose a reason for hiding this comment

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

This PR says it is removing the RSC from being managed. Then I look at the diff and we are adding rbac and updating the adapter

@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

This PR says it is removing the RSC from being managed. Then I look at the diff and we are adding rbac and updating the adapter

Essentially I was going down the road of wanting to use volumeTypes on stage. But the RSC is part of the release service bundle, so it can only be changed if you release a new version of the service.
So I removed it from the service and placed it in infra deployments. I got it work, and was able to update the RSC for only the staging env via Argo and infra deployments.
But then E2E was failing. The reason is that without infra deployments, there is no RSC now.
The pipelines were failing with an error "not able to get RSC"
So I tried to persist the empty RSC when one is not found.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

Copy link
Collaborator

Choose a reason for hiding this comment

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

What is changing that now we need this and we didn't before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

a.releaseServiceConfig = a.getEmptyReleaseServiceConfig(namespace)
patch := client.MergeFrom(a.releaseServiceConfig.DeepCopy())
Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR says it is moving the RSC to being managed in infra-deployments instead of here. So, we are still creating a CR per env. Why do we now need to create it in the adapter?

@johnbieren
Copy link
Collaborator

This PR says it is removing the RSC from being managed. Then I look at the diff and we are adding rbac and updating the adapter

Essentially I was going down the road of wanting to use volumeTypes on stage. But the RSC is part of the release service bundle, so it can only be changed if you release a new version of the service. So I removed it from the service and placed it in infra deployments. I got it work, and was able to update the RSC for only the staging env via Argo and infra deployments. But then E2E was failing. The reason is that without infra deployments, there is no RSC now. The pipelines were failing with an error "not able to get RSC" So I tried to persist the empty RSC when one is not found.

E2E isn't using infra-deployments? How are we using DEPLOY_ONLY in e2e then? What is it using to install?

@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

E2E isn't using infra-deployments? How are we using DEPLOY_ONLY in e2e then? What is it using to install?

I see! I need to get redhat-appstudio/infra-deployments#5508 merged first.

@davidmogar
Copy link
Collaborator

E2E isn't using infra-deployments? How are we using DEPLOY_ONLY in e2e then? What is it using to install?

I see! I need to get redhat-appstudio/infra-deployments#5508 merged first.

That helps... But yeah, don't persist the RSC in that operation please.

- the rsc needs to managed outside of the release
  service so that clusters can have a specific version
  for testing.
- A version can be deployed and managed by ArgoCD
  via infra-deployments for a specific cluster

Signed-off-by: Scott Hebert <[email protected]>
scoheb added a commit to scoheb/konflux-ci that referenced this pull request Feb 11, 2025
- with konflux-ci/release-service#669 and
  redhat-appstudio/infra-deployments#5508
  we need to ensure that a default ReleaseServiceConfig is present
  when the release controller is running.

Signed-off-by: Scott Hebert <[email protected]>
@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

also created konflux-ci/konflux-ci#1285

@scoheb
Copy link
Collaborator Author

scoheb commented Feb 11, 2025

closed in favour of #672

@scoheb scoheb closed this Feb 11, 2025
@konflux-ci-qe-bot
Copy link

@scoheb: The following test has Failed, say /retest to rerun failed tests.

PipelineRun Name Status Rerun command Build Log Test Log
konflux-e2e-tests-qrgsg Failed /retest View Pipeline Log View Test Logs

Inspecting Test Artifacts

To inspect your test artifacts, follow these steps:

  1. Install ORAS (see the ORAS installation guide).
  2. Download artifacts with the following commands:
mkdir -p oras-artifacts
cd oras-artifacts
oras pull quay.io/konflux-test-storage/konflux-team/release-service:konflux-e2e-tests-qrgsg

Test results analysis

🚨 Error occurred while running the E2E tests, list of failed Spec(s):

➡️ [failed] [It] [release-service-suite Release service happy path] Post-release verification verifies that Release PipelineRun is triggered [release-service, happy-path]

Click to view logs

Error when waiting for a release pipelinerun for release happy-path-sbjp-tenant/snapshot-sample-vzdh-xd222 to finish
Expected success, but got an error:
    <*errors.errorString | 0xc000e40720>: 
    Pipelinerun 'managed-x55kc' didn't succeed
    Logs from failed container 'managed-x55kc-collect-data/step-collect-data': 
    {
        "apiVersion": "appstudio.redhat.com/v1alpha1",
        "kind": "Release",
        "metadata": {
            "creationTimestamp": "2025-02-11T14:47:14Z",
            "finalizers": [
                "appstudio.redhat.com/release-finalizer"
            ],
            "generateName": "snapshot-sample-vzdh-",
            "generation": 1,
            "labels": {
                "appstudio.openshift.io/component": "dc-metro-map",
                "pac.test.appstudio.openshift.io/event-type": "push",
                "release.appstudio.openshift.io/automated": "true"
            },
            "name": "snapshot-sample-vzdh-xd222",
            "namespace": "happy-path-sbjp-tenant",
            "ownerReferences": [
                {
                    "apiVersion": "appstudio.redhat.com/v1alpha1",
                    "blockOwnerDeletion": true,
                    "controller": true,
                    "kind": "Application",
                    "name": "appstudio",
                    "uid": "4f48479e-e8e1-4cd1-9ad1-7e3a82072dc0"
                }
            ],
            "resourceVersion": "53213",
            "uid": "8e0c52e2-13ed-4202-ae66-62aebde1ec35"
        },
        "spec": {
            "gracePeriodDays": 7,
            "releasePlan": "source-releaseplan",
            "snapshot": "snapshot-sample-vzdh"
        },
        "status": {
            "attribution": {
                "author": "cluster-admin",
                "standingAuthorization": true
            },
            "automated": true,
            "conditions": [
                {
                    "lastTransitionTime": "2025-02-11T14:47:15Z",
                    "message": "",
                    "reason": "Progressing",
                    "status": "False",
                    "type": "Released"
                },
                {
                    "lastTransitionTime": "2025-02-11T14:47:15Z",
                    "message": "",
                    "reason": "Succeeded",
                    "status": "True",
                    "type": "Validated"
                },
                {
                    "lastTransitionTime": "2025-02-11T14:47:15Z",
                    "message": "",
                    "reason": "Skipped",
                    "status": "True",
                    "type": "TenantCollectorsPipelineProcessed"
                },
                {
                    "lastTransitionTime": "2025-02-11T14:47:15Z",
                    "message": "",
                    "reason": "Skipped",
                    "status": "True",
                    "type": "ManagedCollectorsPipelineProcessed"
                },
                {
                    "lastTransitionTime": "2025-02-11T14:47:15Z",
                    "message": "",
                    "reason": "Skipped",
                    "status": "True",
                    "type": "TenantPipelineProcessed"
                },
                {
                    "lastTransitionTime": "2025-02-11T14:47:15Z",
                    "message": "",
                    "reason": "Progressing",
                    "status": "False",
                    "type": "ManagedPipelineProcessed"
                }
            ],
            "expirationTime": "2025-02-18T14:47:14Z",
            "managedProcessing": {
                "pipelineRun": "happy-path-managed-pwts/managed-x55kc",
                "roleBinding": "happy-path-sbjp-tenant/snapshot-sample-vzdh-xd222-rolebinding-for-release-pipelingtrf7",
                "startTime": "2025-02-11T14:47:15Z"
            },
            "startTime": "2025-02-11T14:47:15Z",
            "target": "happy-path-managed-pwts",
            "validation": {
                "time": "2025-02-11T14:47:15Z"
            }
        }
    }
    {
        "apiVersion": "appstudio.redhat.com/v1alpha1",
        "kind": "ReleasePlan",
        "metadata": {
            "creationTimestamp": "2025-02-11T14:47:14Z",
            "generateName": "source-releaseplan",
            "generation": 1,
            "labels": {
                "release.appstudio.openshift.io/author": "cluster-admin",
                "release.appstudio.openshift.io/auto-release": "true",
                "release.appstudio.openshift.io/standing-attribution": "true"
            },
            "name": "source-releaseplan",
            "namespace": "happy-path-sbjp-tenant",
            "ownerReferences": [
                {
                    "apiVersion": "appstudio.redhat.com/v1alpha1",
                    "blockOwnerDeletion": true,
                    "controller": true,
                    "kind": "Application",
                    "name": "appstudio",
                    "uid": "4f48479e-e8e1-4cd1-9ad1-7e3a82072dc0"
                }
            ],
            "resourceVersion": "53060",
            "uid": "351cb644-5f64-4258-9b8f-c03f11c3e4aa"
        },
        "spec": {
            "application": "appstudio",
            "releaseGracePeriodDays": 7,
            "target": "happy-path-managed-pwts"
        },
        "status": {
            "conditions": [
                {
                    "lastTransitionTime": "2025-02-11T14:47:14Z",
                    "message": "",
                    "reason": "Matched",
                    "status": "True",
                    "type": "Matched"
                }
            ],
            "releasePlanAdmission": {
                "active": true,
                "name": "happy-path-managed-pwts/demo"
            }
        }
    }
    {
        "apiVersion": "appstudio.redhat.com/v1alpha1",
        "kind": "ReleasePlanAdmission",
        "metadata": {
            "creationTimestamp": "2025-02-11T14:47:14Z",
            "generation": 1,
            "labels": {
                "release.appstudio.openshift.io/auto-release": "true"
            },
            "name": "demo",
            "namespace": "happy-path-managed-pwts",
            "resourceVersion": "53053",
            "uid": "aa18816e-ea5a-4136-8e55-7a1a725bef28"
        },
        "spec": {
            "applications": [
                "appstudio"
            ],
            "data": {
                "mapping": {
                    "components": [
                        {
                            "component": "",
                            "repository": "quay.io/redhat-appstudio-qe/dcmetromap"
                        }
                    ]
                }
            },
            "origin": "happy-path-sbjp-tenant",
            "pipeline": {
                "pipelineRef": {
                    "params": [
                        {
                            "name": "url",
                            "value": "https://github.com/konflux-ci/release-service-catalog"
                        },
                        {
                            "name": "revision",
                            "value": "development"
                        },
                        {
                            "name": "pathInRepo",
                            "value": "pipelines/managed/e2e/e2e.yaml"
                        }
                    ],
                    "resolver": "git"
                },
                "serviceAccountName": "release-service-account",
                "timeouts": {}
            },
            "policy": "hpath-policy-bfcr"
        },
        "status": {
            "conditions": [
                {
                    "lastTransitionTime": "2025-02-11T14:47:14Z",
                    "message": "",
                    "reason": "Matched",
                    "status": "True",
                    "type": "Matched"
                }
            ],
            "releasePlans": [
                {
                    "active": true,
                    "name": "happy-path-sbjp-tenant/source-releaseplan"
                }
            ]
        }
    }
    Error from server (NotFound): releaseserviceconfigs.appstudio.redhat.com "release-service-config" not found
    
    {
        s: "Pipelinerun 'managed-x55kc' didn't succeed\nLogs from failed container 'managed-x55kc-collect-data/step-collect-data': \n{\n    \"apiVersion\": \"appstudio.redhat.com/v1alpha1\",\n    \"kind\": \"Release\",\n    \"metadata\": {\n        \"creationTimestamp\": \"2025-02-11T14:47:14Z\",\n        \"finalizers\": [\n            \"appstudio.redhat.com/release-finalizer\"\n        ],\n        \"generateName\": \"snapshot-sample-vzdh-\",\n        \"generation\": 1,\n        \"labels\": {\n            \"appstudio.openshift.io/component\": \"dc-metro-map\",\n            \"pac.test.appstudio.openshift.io/event-type\": \"push\",\n            \"release.appstudio.openshift.io/automated\": \"true\"\n        },\n        \"name\": \"snapshot-sample-vzdh-xd222\",\n        \"namespace\": \"happy-path-sbjp-tenant\",\n        \"ownerReferences\": [\n            {\n                \"apiVersion\": \"appstudio.redhat.com/v1alpha1\",\n                \"blockOwnerDeletion\": true,\n                \"controller\": true,\n                \"kind\": \"Application\",\n                \"name\": \"appstudio\",\n                \"uid\": \"4f48479e-e8e1-4cd1-9ad1-7e3a82072dc0\"\n            }\n        ],\n        \"resourceVersion\": \"53213\",\n        \"uid\": \"8e0c52e2-13ed-4202-ae66-62aebde1ec35\"\n    },\n    \"spec\": {\n        \"gracePeriodDays\": 7,\n        \"releasePlan\": \"source-releaseplan\",\n        \"snapshot\": \"snapshot-sample-vzdh\"\n    },\n    \"status\": {\n        \"attribution\": {\n            \"author\": \"cluster-admin\",\n            \"standingAuthorization\": true\n        },\n        \"automated\": true,\n        \"conditions\": [\n            {\n                \"lastTransitionTime\": \"2025-02-11T14:47:15Z\",\n                \"message\": \"\",\n                \"reason\": \"Progressing\",\n                \"status\": \"False\",\n                \"type\": \"Released\"\n            },\n            {\n                \"lastTransitionTime\": \"2025-02-11T14:47:15Z\",\n                \"message\": \"\",\n                \"reason\": \"Succeeded\",\n                \"status\": \"True\",\n                \"type\": \"Validated\"\n            },\n            {\n                \"lastTransitionTime\": \"2025-02-11T14:47:15Z\",\n                \"message\": \"\",\n                \"reason\": \"Skipped\",\n                \"status\": \"True\",\n                \"type\": \"TenantCollectorsPipelineProcessed\"\n            },\n            {\n                \"lastTransitionTime\": \"2025-02-11T14:47:15Z\",\n                \"message\": \"\",\n                \"reason\": \"Skipped\",\n                \"status\": \"True\",\n                \"type\": \"ManagedCollectorsPipelineProcessed\"\n            },\n            {\n                \"lastTransitionTime\": \"2025-02-11T14:47:15Z\",\n                \"message\": \"\",\n                \"reason\": \"Skipped\",\n                \"status\": \"True\",\n                \"type\": \"TenantPipelineProcessed\"\n            },\n            {\n                \"lastTransitionTime\": \"2025-02-11T14:47:15Z\",\n                \"message\": \"\",\n                \"reason\": \"Progressing\",\n                \"status\": \"False\",\n                \"type\": \"ManagedPipelineProcessed\"\n            }\n        ],\n        \"expirationTime\": \"2025-02-18T14:47:14Z\",\n        \"managedProcessing\": {\n            \"pipelineRun\": \"happy-path-managed-pwts/managed-x55kc\",\n            \"roleBinding\": \"happy-path-sbjp-tenant/snapshot-sample-vzdh-xd222-rolebinding-for-release-pipelingtrf7\",\n            \"startTime\": \"2025-02-11T14:47:15Z\"\n        },\n        \"startTime\": \"2025-02-11T14:47:15Z\",\n        \"target\": \"happy-path-managed-pwts\",\n        \"validation\": {\n            \"time\": \"2025-02-11T14:47:15Z\"\n        }\n    }\n}\n{\n    \"apiVersion\": \"appstudio.redhat.com/v1alpha1\",\n    \"kind\": \"ReleasePlan\",\n    \"metadata\": {\n        \"creationTimestamp\": \"...

Gomega truncated this representation as it exceeds 'format.MaxLength'.
Consider having the object provide a custom 'GomegaStringer' representation
or adjust the parameters in Gomega's 'format' package.

Learn more here: https://onsi.github.io/gomega/#adjusting-output

psturc pushed a commit to konflux-ci/konflux-ci that referenced this pull request Feb 18, 2025
- with konflux-ci/release-service#669 and
  redhat-appstudio/infra-deployments#5508
  we need to ensure that a default ReleaseServiceConfig is present
  when the release controller is running.

Signed-off-by: Scott Hebert <[email protected]>
github-merge-queue bot pushed a commit to konflux-ci/konflux-ci that referenced this pull request Feb 18, 2025
- with konflux-ci/release-service#669 and
  redhat-appstudio/infra-deployments#5508
  we need to ensure that a default ReleaseServiceConfig is present
  when the release controller is running.

Signed-off-by: Scott Hebert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants