OpenAPITools / OpenAPITools/openapi-diff

TeamCity renderer

Đang mở
#849 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Render capabilities
Ngôn ngữ chính
Java
Star
1.1k
Fork
190
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

It would be nice if there were a built-in TeamCity renderer, that can render TeamCity service messages, like for example

##teamcity[inspectionType category='openapi-diff' id='new-endpoint' name='New Endpoint' description='info -- New Endpoint']
##teamcity[inspection typeId='new-endpoint' file='build\openapi.json' message='info -- New Endpoint GET /showcase/v1/open/{id} - Query something totally open' SEVERITY='INFO']
##teamcity[inspection typeId='new-endpoint' file='build\openapi.json' message='info -- New Endpoint GET /showcase/v1/open/{open-id}/samples/{sample-id}/sub-samples/{sub-sample-id} - Query something else totally open' SEVERITY='INFO']
##teamcity[inspectionType category='openapi-diff' id='deleted-endpoint' name='Deleted Endpoint' description='error -- Deleted Endpoint']
##teamcity[inspection typeId='deleted-endpoint' file='build\openapi.json' message='error -- Deleted Endpoint GET /showcase/v1/whatever - Get whatever' SEVERITY='ERROR']
##teamcity[inspection typeId='deleted-endpoint' file='build\openapi.json' message='error -- Deleted Endpoint GET /showcase/v2/whatever - Get whatever else' SEVERITY='ERROR']
##teamcity[inspectionType category='openapi-diff' id='changed-operation' name='Changed Operation' description='Changed Operation']
##teamcity[inspection typeId='changed-operation' file='build\openapi.json' message='info -- Non-breakingly changed operation GET /showcase/v1/foo' SEVERITY='INFO']
##teamcity[inspection typeId='changed-operation' file='build\openapi.json' message='error -- Breakingly changed operation POST /showcase/v1/bar' SEVERITY='ERROR']
##teamcity[inspection typeId='changed-operation' file='build\openapi.json' message='error -- Breakingly changed operation POST /showcase/v1/bar/{bar-id}/baz/{baz-id}/boo' SEVERITY='ERROR']

In the CLI if enabled (or if TeamCity detected) this renderer should write to stdout.
When using via code, it should be a renderer like the others so that it can also be transformered or processed as necessary (like having one Gradle task that has it as output file and another that writes it to stdout so that the generation can be cached while the service messages will still be printed and thus processed).

The inspections can of course also be more fine-grained like for each specific change.
Or having more extensive messages which also support HTML (see linked docs).

Two things to keep in mind:

  • While the docs list SEVERITY as custom attribute it should still be used as TeamCity indeed considers it to differentiate between error and non-errors
  • Texts that could contain some special characters need a special escaping like this one:
    // | => || must be handled first. or we will
    // escape the previously added escape character
    text
        .replace("|", "||")
        .replace("'", "|'")
        .replace("\n", "|n")
        .replace("\r", "|r")
        .replace("[", "|[")
        .replace("]", "|]")
    

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách kiểm tra các renderer hiện có và đường dẫn đầu ra của CLI, sau đó đọc tài liệu TeamCity service messages được liên kết. Xác định cách việc sử dụng renderer từ code và đầu ra của CLI cần hoạt động, bao gồm các yêu cầu về severity và escaping. Hoàn thành khi có thể tạo, chuyển đổi hoặc ghi các inspection messages hợp lệ của TeamCity vào stdout.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
api, cli
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.