20-build-annotation.sql 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 VIEW v_build_annotation_error AS
  10. SELECT
  11. ann.build_id,
  12. ann.build_job_id,
  13. b.pipeline,
  14. b.build_number,
  15. bj.build_step_key,
  16. b.branch,
  17. b.commit_hash,
  18. b.mz_version,
  19. b.date AS build_date,
  20. ann.insert_date AS annotation_insert_date,
  21. ann.test_suite,
  22. ann.test_retry_count,
  23. err.error_type,
  24. err.content,
  25. err.issue,
  26. err.occurrence_count
  27. FROM build_annotation ann
  28. LEFT OUTER JOIN build_annotation_error err
  29. ON ann.build_job_id = err.build_job_id
  30. INNER JOIN build b
  31. ON ann.build_id = b.build_id
  32. INNER JOIN build_job bj
  33. ON ann.build_job_id = bj.build_job_id
  34. ;
  35. CREATE OR REPLACE VIEW v_build_annotation_overview AS
  36. SELECT
  37. bae.build_id,
  38. bae.build_job_id,
  39. bae.pipeline,
  40. bae.build_number,
  41. bae.branch,
  42. bae.commit_hash,
  43. bae.mz_version,
  44. bae.build_date,
  45. bae.test_suite,
  46. bae.test_retry_count,
  47. count(bae.content) AS distinct_error_count
  48. FROM v_build_annotation_error bae
  49. GROUP BY
  50. bae.build_id,
  51. bae.build_job_id,
  52. bae.pipeline,
  53. bae.build_number,
  54. bae.branch,
  55. bae.commit_hash,
  56. bae.mz_version,
  57. bae.build_date,
  58. bae.test_suite,
  59. bae.test_retry_count
  60. ;
  61. ALTER VIEW v_build_annotation_error OWNER TO qa;
  62. ALTER VIEW v_build_annotation_overview OWNER TO qa;