30-ci-failures.sql 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- Copyright Materialize, Inc. and contributors. All rights reserved.
  2. --
  3. -- Use of this software is governed by the Business Source License
  4. -- included in the LICENSE file at the root of this repository.
  5. --
  6. -- As of the Change Date specified in that file, in accordance with
  7. -- the Business Source License, use of this software will be governed
  8. -- by the Apache License, Version 2.0.
  9. CREATE OR REPLACE MATERIALIZED VIEW mv_ci_failures
  10. IN CLUSTER test_analytics AS
  11. SELECT
  12. pipeline || '#' || build_number AS build_identifier,
  13. test_suite,
  14. CASE WHEN error_type = 'KNOWN_ISSUE' THEN issue || ' (KNOWN ISSUE)' ELSE
  15. CASE WHEN error_type = 'POTENTIAL_REGRESSION' THEN issue || ' (POTENTIAL REGRESSION)' ELSE
  16. REPLACE(error_type, '_', ' ') END END AS issue,
  17. string_agg(content, '\n') AS content,
  18. branch,
  19. build_date,
  20. mz_version,
  21. commit_hash,
  22. build_step_key,
  23. test_retry_count,
  24. occurrence_count,
  25. build_id,
  26. build_job_id
  27. FROM v_build_annotation_error
  28. GROUP BY
  29. pipeline,
  30. build_number,
  31. test_suite,
  32. error_type,
  33. issue,
  34. branch,
  35. build_date,
  36. mz_version,
  37. commit_hash,
  38. build_step_key,
  39. test_retry_count,
  40. occurrence_count,
  41. build_id,
  42. build_job_id
  43. ;
  44. CREATE INDEX IN CLUSTER test_analytics ON mv_ci_failures (branch, build_date, issue);
  45. ALTER MATERIALIZED VIEW mv_ci_failures OWNER TO qa;
  46. GRANT SELECT ON mv_ci_failures TO "ci-failures";