31-ci-issues.sql 933 B

12345678910111213141516171819202122232425262728
  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_issues
  10. IN CLUSTER test_analytics AS
  11. SELECT a.*, title, ci_regexp, state
  12. FROM (
  13. SELECT
  14. issue,
  15. count(*) AS occurrences,
  16. min(build_date) AS first_occurrence,
  17. max(build_date) AS last_occurrence
  18. FROM v_build_annotation_error
  19. WHERE issue IS NOT NULL
  20. GROUP BY issue
  21. )
  22. AS a
  23. JOIN issue AS i ON a.issue = i.issue_id
  24. ;
  25. ALTER MATERIALIZED VIEW mv_ci_issues OWNER TO qa;
  26. GRANT SELECT ON mv_ci_issues TO "ci-failures";