jaegertracing / jaeger-ui

Web UI for Jaeger
http://jaegertracing.io/
Apache License 2.0
1.16k stars 486 forks source link

Replace existing get-changelog.js with release-notes.py #904

Open albertteoh opened 2 years ago

albertteoh commented 2 years ago

Requirement - what kind of business use case are you trying to solve?

Generate changelog notes for a Jaeger UI release.

Problem - what in Jaeger blocks you from solving the requirement?

Tried following instructions in https://github.com/jaegertracing/jaeger-ui/blob/main/RELEASE.md which suggests using get-changelog.js, but resulted in:

$ node ./scripts/get-changelog.js
TypeError: Cannot read property 'textContent' of null
    at getData (/vagrant/go/src/github.com/albertteoh/jaeger-ui/scripts/get-changelog.js:36:49)
    at Array.map (<anonymous>)
    at getPrData (/vagrant/go/src/github.com/albertteoh/jaeger-ui/scripts/get-changelog.js:54:19)
    at fetch.then.then.textContent (/vagrant/go/src/github.com/albertteoh/jaeger-ui/scripts/get-changelog.js:65:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
TypeError: Cannot destructure property `pid` of 'undefined' or 'null'.
    at console.log.items.filter (/vagrant/go/src/github.com/albertteoh/jaeger-ui/scripts/get-changelog.js:97:19)
    at Array.filter (<anonymous>)
    at Promise.all.then (/vagrant/go/src/github.com/albertteoh/jaeger-ui/scripts/get-changelog.js:97:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Being a relative newbie to javascript, I may have not used the correct command to execute this script.

Proposal - what do you suggest to solve the problem or improve the existing situation?

Given Jaeger UI releases are, more or less, coupled to Jaeger releases, I propose that Jaeger UI adopt the same changelog generation scripts as Jaeger.

This was tested against Jaeger UI without any modifications to the existing release-notes.py.

$ python release-notes.py --repo jaeger-ui --exclude-dependabot

There are 16 new commits since v1.20.1
https://api.github.com/repos/jaegertracing/jaeger-ui/commits?per_page=16
Retrieved 16 commits
* Include serviceName in tracked events from Search Form ([@vvvprabhakar](https://github.com/vvvprabhakar) in [#842](https://github.com/jaegertracing/jaeger-ui/pull/842))
* Monitor Tab: Cannot see the whole numbers in the legend ([@nofar9792](https://github.com/nofar9792) in [#873](https://github.com/jaegertracing/jaeger-ui/pull/873))
* Monitor Tab: Cannot choose another timeframe ([@nofar9792](https://github.com/nofar9792) in [#898](https://github.com/jaegertracing/jaeger-ui/pull/898))
* Monitor Tab - Error rate value should be 0-100 value and not 0-1 ([@nofar9792](https://github.com/nofar9792) in [#895](https://github.com/jaegertracing/jaeger-ui/pull/895))
* Monitor Tab - show 95 Latency in a more readable time-unit ([@nofar9792](https://github.com/nofar9792) in [#893](https://github.com/jaegertracing/jaeger-ui/pull/893))
* Request rate ([@nofar9792](https://github.com/nofar9792) in [#890](https://github.com/jaegertracing/jaeger-ui/pull/890))
* Monitor Tab - The x-axis timeframe should be according to the selected timeframe ([@nofar9792](https://github.com/nofar9792) in [#886](https://github.com/jaegertracing/jaeger-ui/pull/886))
* Monitor Tab - Crosshair Color is too light ([@nofar9792](https://github.com/nofar9792) in [#888](https://github.com/jaegertracing/jaeger-ui/pull/888))
* Reduce ratePer window ([@albertteoh](https://github.com/albertteoh) in [#885](https://github.com/jaegertracing/jaeger-ui/pull/885))

(Skipped 7 dependabot commits)

I propose to encapsulate this within a Makefile target so the usage should be:

make changelog
albertteoh commented 2 years ago

The simplest approach is to copy the release-notes.py script from jaegertracing/jaeger.

The trade-off is that this could get out of sync with jaegertracing/jaeger's version, so a potential alternative is to explore a file-sync mechanism and maintaining jaegertracing/jaeger's script as the canonical version: https://github.com/marketplace/actions/repo-file-sync-action.

The benefit of the latter approach is that it should scale quite easily to other jaegertracing repos like jaeger-operator, etc... which seem to either have no automated means of generating changelogs, or perhaps bespoke scripts to achieve the same.