Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

fix: add resiliency when an integration cannot be added to a policy #1914

Merged
merged 4 commits into from
Dec 16, 2021

Conversation

mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Dec 16, 2021

What does this PR do?

It does two things:

  1. changes log.Fatal to log.Error on failures when adding an integration to a policy
  2. adds a retry with maxTimeout option to the addIntegrationToPolicy method, so that we are covered on errors in the staging environment of the package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy err="could not add package to policy; API status code = 500; response body = {"statusCode":500,"error":"Internal Server Error","message":"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true [] { endpoint Endpoint Security 1.4.0}}"

Why is it important?

Resiliency in the pipeline execution

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have run the Unit tests (make unit-test), and they are passing locally
  • I have run the End-2-End tests for the suite I'm working on, and they are passing locally
  • I have noticed new Go dependencies (run make notice in the proper directory)

We have detected 500 codes in the staging environment of package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy           err="could not add package to policy; API status code = 500; response body = {\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true  [] { endpoint Endpoint Security 1.4.0}}"
@mdelapenya mdelapenya added Team:Automation Label for the Observability productivity team Team:Integrations Label for the Integrations team backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify bug Something isn't working labels Dec 16, 2021
@mdelapenya mdelapenya self-assigned this Dec 16, 2021
@mdelapenya mdelapenya requested a review from a team December 16, 2021 06:40
@mdelapenya mdelapenya added the backport-v7.15.0 Automated backport with mergify label Dec 16, 2021
@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 16, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-12-16T09:43:49.289+0000

  • Duration: 33 min 22 sec

  • Commit: b71e5ad

Test stats 🧪

Test Results
Failed 0
Passed 86
Skipped 0
Total 86

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@mdelapenya mdelapenya merged commit 66d399a into elastic:master Dec 16, 2021
mergify bot pushed a commit that referenced this pull request Dec 16, 2021
…1914)

* chore: do not exit if the integration cannot be added to the policy

* chore: add resiliency when adding an integration to a policy

We have detected 500 codes in the staging environment of package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy           err="could not add package to policy; API status code = 500; response body = {\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true  [] { endpoint Endpoint Security 1.4.0}}"

* fix: add missing return

* fix: format source

(cherry picked from commit 66d399a)
mergify bot pushed a commit that referenced this pull request Dec 16, 2021
…1914)

* chore: do not exit if the integration cannot be added to the policy

* chore: add resiliency when adding an integration to a policy

We have detected 500 codes in the staging environment of package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy           err="could not add package to policy; API status code = 500; response body = {\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true  [] { endpoint Endpoint Security 1.4.0}}"

* fix: add missing return

* fix: format source

(cherry picked from commit 66d399a)
mergify bot pushed a commit that referenced this pull request Dec 16, 2021
…1914)

* chore: do not exit if the integration cannot be added to the policy

* chore: add resiliency when adding an integration to a policy

We have detected 500 codes in the staging environment of package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy           err="could not add package to policy; API status code = 500; response body = {\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true  [] { endpoint Endpoint Security 1.4.0}}"

* fix: add missing return

* fix: format source

(cherry picked from commit 66d399a)
mdelapenya added a commit that referenced this pull request Dec 16, 2021
…1914) (#1918)

* chore: do not exit if the integration cannot be added to the policy

* chore: add resiliency when adding an integration to a policy

We have detected 500 codes in the staging environment of package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy           err="could not add package to policy; API status code = 500; response body = {\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true  [] { endpoint Endpoint Security 1.4.0}}"

* fix: add missing return

* fix: format source

(cherry picked from commit 66d399a)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Dec 16, 2021
…1914) (#1919)

* chore: do not exit if the integration cannot be added to the policy

* chore: add resiliency when adding an integration to a policy

We have detected 500 codes in the staging environment of package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy           err="could not add package to policy; API status code = 500; response body = {\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true  [] { endpoint Endpoint Security 1.4.0}}"

* fix: add missing return

* fix: format source

(cherry picked from commit 66d399a)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit that referenced this pull request Dec 17, 2021
…1914) (#1920)

* chore: do not exit if the integration cannot be added to the policy

* chore: add resiliency when adding an integration to a policy

We have detected 500 codes in the staging environment of package-registry

[2021-12-16T05:41:55.069Z] FATA[2021-12-16T05:41:53Z] Unable to add integration to policy           err="could not add package to policy; API status code = 500; response body = {\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"'502 Bad Gateway' error response from package registry at https://epr-staging.elastic.co/package/endpoint/1.4.0\"}" packageDS="{ endpoint-50fff084-9495-4633-b1a7-0a817b61d6bc Endpoint Security default cdd3d370-5e32-11ec-9ece-534be1f506d0 true  [] { endpoint Endpoint Security 1.4.0}}"

* fix: add missing return

* fix: format source

(cherry picked from commit 66d399a)

Co-authored-by: Manuel de la Peña <[email protected]>
mdelapenya added a commit to mdelapenya/e2e-testing that referenced this pull request Mar 30, 2022
* main:
  chore: retire 7.15 adding 7.17 (elastic#1938)
  ci: use withAPMEnv (elastic#1917)
  Update main branch (elastic#1928)
  bump stack version 8.1.0-befff95a (elastic#1929)
  chore: properly evaluate how tests are skipped on CI when checking modified files (elastic#1924)
  bump stack version 8.1.0-60bffc32 (elastic#1921)
  fix: add resiliency when an integration cannot be added to a policy (elastic#1914)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport-v7.15.0 Automated backport with mergify backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify bug Something isn't working Team:Automation Label for the Observability productivity team Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants