diff --git a/.gitignore b/.gitignore index 1d2e360c19..b1f7036eb5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,8 @@ npm-debug.log yarn-error.log lerna-debug.log .eslintcache -.vscode \ No newline at end of file +.vscode + +# scripts +scripts/release-notes.py +scripts/draft-release.py diff --git a/.prettierignore b/.prettierignore index 33d7e71d2f..2bef41ec0b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,9 @@ # Ignore generated files -packages/jaeger-ui/index.d.ts \ No newline at end of file +packages/jaeger-ui/index.d.ts + +# Ignore downloaded scripts +scripts/release-notes.py +scripts/draft-release.py + +# Ignore CHANGELOG.md because prettier has different ideas about its formatting. +CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b0909cf56..4692f31fd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,35 @@ ### Fixes +## v1.34.0 (2023-10-04) + +### Enhancements + +- Handle Critical Path computation when child span starts before and ends after parent span. ([@GLVSKiriti](https://github.com/GLVSKiriti) in [#1780](https://github.com/jaegertracing/jaeger-ui/pull/1780)) + +### Fixes + +- Restore ability to search in select fields ([@prathamesh-mutkure](https://github.com/prathamesh-mutkure) in [#1805](https://github.com/jaegertracing/jaeger-ui/pull/1805)) +- Replace match.params with useparams hook ([@anshgoyalevil](https://github.com/anshgoyalevil) in [#1837](https://github.com/jaegertracing/jaeger-ui/pull/1837)) +- Add custom withrouteprops hoc for react-router-dom v6 migration ([@anshgoyalevil](https://github.com/anshgoyalevil) in [#1836](https://github.com/jaegertracing/jaeger-ui/pull/1836)) +- Remove unused icon ([@priyanshu-kun](https://github.com/priyanshu-kun) in [#1829](https://github.com/jaegertracing/jaeger-ui/pull/1829)) +- Improve tooltip for elasticsearch tag queries ([@pavolloffay](https://github.com/pavolloffay) in [#1809](https://github.com/jaegertracing/jaeger-ui/pull/1809)) +- Replace react-router-redux with redux-first-history ([@anshgoyalevil](https://github.com/anshgoyalevil) in [#1826](https://github.com/jaegertracing/jaeger-ui/pull/1826)) +- Fix all controversial icons. ([@priyanshu-kun](https://github.com/priyanshu-kun) in [#1824](https://github.com/jaegertracing/jaeger-ui/pull/1824)) +- Speed up tests locally by upto 45% ([@anshgoyalevil](https://github.com/anshgoyalevil) in [#1818](https://github.com/jaegertracing/jaeger-ui/pull/1818)) +- Priyanshu kun/clean any ([@priyanshu-kun](https://github.com/priyanshu-kun) in [#1814](https://github.com/jaegertracing/jaeger-ui/pull/1814)) +- Moment.js replaced with dayjs ([@prathamesh-mutkure](https://github.com/prathamesh-mutkure) in [#1738](https://github.com/jaegertracing/jaeger-ui/pull/1738)) +- Replaced all uncontroversial icons from various icon sets to io5 ([@priyanshu-kun](https://github.com/priyanshu-kun) in [#1771](https://github.com/jaegertracing/jaeger-ui/pull/1771)) +- Speed up ci unit-test workflow by 28% ([@anshgoyalevil](https://github.com/anshgoyalevil) in [#1804](https://github.com/jaegertracing/jaeger-ui/pull/1804)) +- Fix linting warnings for no-unused-vars, no-var-requires ([@priyanshu-kun](https://github.com/priyanshu-kun) in [#1800](https://github.com/jaegertracing/jaeger-ui/pull/1800)) +- Improve tooltip for tag search ([@yurishkuro](https://github.com/yurishkuro) in [#1799](https://github.com/jaegertracing/jaeger-ui/pull/1799)) +- Fix copyicon to receive reactnode instead of string ([@anshgoyalevil](https://github.com/anshgoyalevil) in [#1791](https://github.com/jaegertracing/jaeger-ui/pull/1791)) +- Refactor critical path code to prevent it from ever throwing exceptions ([@GLVSKiriti](https://github.com/GLVSKiriti) in [#1785](https://github.com/jaegertracing/jaeger-ui/pull/1785)) +- Print suggestion on fixing prettier-lint errors ([@yurishkuro](https://github.com/yurishkuro) in [#1783](https://github.com/jaegertracing/jaeger-ui/pull/1783)) +- Upgrade to node 18 ([@yurishkuro](https://github.com/yurishkuro) in [#1776](https://github.com/jaegertracing/jaeger-ui/pull/1776)) +- Extend try/catch for critical path ([@yurishkuro](https://github.com/yurishkuro) in [#1778](https://github.com/jaegertracing/jaeger-ui/pull/1778)) +- Convert utils/treenode.js and selectors/trace.js to typescript ([@yurishkuro](https://github.com/yurishkuro) in [#1777](https://github.com/jaegertracing/jaeger-ui/pull/1777)) + ## v1.33.0 (2023-08-06) ### Enhancements diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..27da6a90cd --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +.PHONY: changelog +changelog: + wget https://raw.githubusercontent.com/jaegertracing/jaeger/main/scripts/release-notes.py -O ./scripts/release-notes.py -q + chmod 755 ./scripts/release-notes.py + ./scripts/release-notes.py --exclude-dependabot --repo jaeger-ui + +.PHONY: draft-release +draft-release: + wget https://raw.githubusercontent.com/jaegertracing/jaeger/main/scripts/draft-release.py -O ./scripts/draft-release.py -q + chmod 755 ./scripts/draft-release.py + ./scripts/draft-release.py --title "Jaeger UI" --repo jaeger-ui diff --git a/RELEASE.md b/RELEASE.md index a1aa9c6e10..ca2d7a3ea9 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,20 +1,16 @@ # Cutting a Jaeger UI release -1. Determine the version for the release. - - Follow [semver.org](https://semver.org) to determine the new version for Jaeger UI. - - Review all changes since the last release to determine how, if at all, any externally facing APIs are impacted. This includes, but is not limited to, the UI config and URL routes such as deep-linking and configuring the embedded mode. - - Preface the version with a "v", e.g. `v1.0.0`. -1. Create and merge, per approval, a PR which preps the release. +1. Create and merge, per approval, a PR which preps the release ([example](https://github.com/jaegertracing/jaeger-ui/pull/1767)). 1. The PR title should match the format "Prepare release vX.Y.Z". - 1. CHANGELOG.md - - Change the version of the current release from "Next (unreleased)" to "vX.Y.Z (Month D, YYYY)" where "vX.Y.Z" is the semver for this release. - - Make sure all relevant changes made since the last release are present and listed under the current release. - - Tip: Run `node scripts/get-changelog.js` script that prints a dozen most recent commits in the chagelog format. + 2. CHANGELOG.md + - Change the version of the current release from "Next (unreleased)" to "vX.Y.Z (Month D, YYYY)" where "vX.Y.Z" is the [semver](https://semver.org) for this release. + - Run `make changelog` to list all changes since the last release. + - Review all changes to determine how, if at all, any externally facing APIs are impacted. This includes, but is not limited to, the UI config and URL routes such as deep-linking and configuring the embedded mode. - If necessary, add a note detailing any impact to externally facing APIs. - 1. Update `packages/jaeger-ui/package.json#version` to refer to the version being released. -1. Create a GitHub release. + 3. Update `packages/jaeger-ui/package.json#version` to refer to the version being released. +2. Create a GitHub release. - Automated (requires [gh](https://cli.github.com/manual/installation)): - - `python ./scripts/draft-release.py` + - `make draft-release` - Manual: - The tag and release must refer to the commit created when the PR from the previous step was merged. - The tag name for the GitHub release should be the version for the release. It should include the "v", e.g. `v1.0.0`. diff --git a/packages/jaeger-ui/package.json b/packages/jaeger-ui/package.json index 59b24577e5..ffb73a5e36 100644 --- a/packages/jaeger-ui/package.json +++ b/packages/jaeger-ui/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "jaeger-ui", - "version": "1.33.0", + "version": "1.34.0", "main": "src/index.tsx", "license": "Apache-2.0", "homepage": ".", diff --git a/scripts/get-changelog.js b/scripts/get-changelog.js deleted file mode 100755 index 177d5c2121..0000000000 --- a/scripts/get-changelog.js +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env node - -// Copyright (c) 2019 Uber Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This code will generate changelog entries - -/* eslint-disable @typescript-eslint/no-var-requires */ -const { readFile } = require('fs').promises; -// eslint-disable-next-line import/no-extraneous-dependencies -const jsdom = require('jsdom'); - -const readFilePromise = readFile; - -const DOMAIN = 'https://github.com/'; -const JAEGER_REPO = process.env.JAEGER_REPO || 'jaeger-ui'; - -const URL_PARTS = [ - `${DOMAIN}jaegertracing/${JAEGER_REPO}/pulls?page=`, - '&q=is%3Apr+is%3Amerged&utf8=%E2%9C%93', -]; - -function getData(elm) { - const title = elm.querySelector('[data-hovercard-type="pull_request"]').textContent; - const url = elm.querySelector('[data-hovercard-type="pull_request"]').href; - const pid = /#\d+/g.exec(elm.querySelector('.opened-by').textContent)[0]; - const user = elm.querySelector('a.Link--muted').textContent; - const dateMerged = new Date(elm.querySelector('[datetime]').getAttribute('datetime')); - return { title, url, pid, user, dateMerged }; -} - -function fmtPr(data) { - const { title, url, pid, user } = data; - return `- ${title} ([@${user}](https://github.com/${user}) in [${pid}](${url}))`; -} - -function compareMergedDates(a, b) { - return a.dateMerged > b.dateMerged ? 1 : Number(a.dateMerged === b.dateMerged) - 1; -} - -function getPrData(document) { - const wrapper = document.querySelector('[aria-label="Issues"][role="group"]'); - const issues = [].slice.call(wrapper.querySelectorAll('.js-issue-row')); - const okIssues = issues.filter(elm => !elm.querySelector('[aria-label*="Closed"]')); - return okIssues.map(getData); -} - -function getMergedPrs(page) { - const _page = page == null || Number.isNaN(page) ? 1 : Number(page); - const url = URL_PARTS.join(_page); - return ( - fetch(url) - .then(resp => resp.text()) - .then(textContent => { - const dom = new jsdom.JSDOM(textContent, { url: DOMAIN }); - return getPrData(dom.window.document); - }) - // eslint-disable-next-line no-console - .catch(error => console.error(error)) - ); -} - -function getChangelog(pages) { - const _pages = pages == null || Number.isNaN(pages) ? 1 : Number(pages); - const promises = []; - for (let i = 1; i <= _pages; i++) { - promises.push(getMergedPrs(i)); - } - return ( - Promise.all(promises) - .then(groups => [].concat(...groups)) - .then(items => { - items.sort(compareMergedDates); - items.reverse(); - return items; - }) - // eslint-disable-next-line no-console - .catch(error => console.error(error)) - ); -} - -if (require.main === module) { - Promise.all([getChangelog(process.argv[2] || 1), readFilePromise('./CHANGELOG.md', 'utf8')]) - .then(([items, changelog]) => - // eslint-disable-next-line no-console - console.log( - items - .filter(({ pid, url }) => changelog.indexOf(`[${pid}](${url})`) === -1) - .map(fmtPr) - .join('\n\n') - ) - ) - // eslint-disable-next-line no-console - .catch(error => console.error(error)); -} else { - module.exports = getChangelog; -} diff --git a/scripts/get-tracking-version.js b/scripts/get-tracking-version.js deleted file mode 100755 index 0e5d188686..0000000000 --- a/scripts/get-tracking-version.js +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env node - -// Copyright (c) 2017 Uber Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// See the comment on `getVersion(..)` for details on what this script does. - -/* eslint-disable @typescript-eslint/no-var-requires */ -const spawnSync = require('child_process').spawnSync; - -const version = require('../package.json').version; - -function cleanRemoteUrl(url) { - return url.replace(/^(.*?@|.*?\/\/)|\.git\s*$/gi, '').replace(/:/g, '/'); -} - -function cleanBranchNames(pointsAt) { - const branch = pointsAt.replace(/"/g, '').split('\n')[0]; - const i = branch.indexOf(' '); - const objName = branch.slice(0, i); - let refName = branch.slice(i + 1); - if (refName.indexOf('detached') > -1) { - refName = '(detached)'; - } - return { objName, refName }; -} - -function getChanged(shortstat, status) { - const rv = { hasChanged: false, files: 0, insertions: 0, deletions: 0, untracked: 0 }; - const joiner = []; - const regex = /(\d+) (.)/g; - let match = regex.exec(shortstat); - while (match) { - const [, n, type] = match; - switch (type) { - case 'f': - rv.files = Number(n); - joiner.push(`${n}f`); - break; - case 'i': - rv.insertions = Number(n); - joiner.push(`+${n}`); - break; - case 'd': - rv.deletions = Number(n); - joiner.push(`-${n}`); - break; - default: - throw new Error(`Invalid diff type: ${type}`); - } - match = regex.exec(shortstat); - } - const untracked = status && status.split('\n').filter(line => line[0] === '?').length; - if (untracked) { - rv.untracked = untracked; - joiner.push(`${untracked}?`); - } - rv.pretty = joiner.join(' '); - rv.hasChanged = Boolean(joiner.length); - return rv; -} - -// This util function, which can be used via the CLI or as a module, outputs -// a JSON blob indicating the git state of a repo. It defaults to checking the -// repo at ".", but accepts a working directory. -// -// The output is along the lines of the following: -// -// { -// "version": "0.0.1", -// "remote": "github.com/jaegertracing/jaeger-ui", -// "objName": "64fbc13", -// "changed": { -// "hasChanged": true, -// "files": 1, -// "insertions": 21, -// "deletions": 0, -// "untracked": 0, -// "pretty": "1f +21" -// }, -// "refName": "issue-39-track-js-errors", -// "pretty": "0.0.1 | github.com/jaegertracing/jaeger-ui | 64fbc13 | 1f +21 | issue-39-track-js-errors" -// } -// -// * version: The package.json version -// * remote: The git remote URL (normalized) -// * objName: The short SHA -// * changed: Indicates any changes in the repo -// * changed.pretty: formatted as "2f +3 -4 5?", which indicates two modified -// files having three insertions, 4 deletions, and 5 untracked files -// * refName: The name of the current branch, "(detached)" when the head is detached -// * pretty: A human-readable representation of the above fields -function getVersion(cwd) { - const opts = { cwd, encoding: 'utf8' }; - const url = spawnSync('git', ['remote', 'get-url', '--push', 'origin'], opts).stdout; - const branch = spawnSync( - 'git', - ['branch', '--points-at', 'HEAD', '--format="%(objectname:short) %(refname:short)"'], - opts - ).stdout; - const shortstat = spawnSync('git', ['diff-index', '--shortstat', 'HEAD'], opts).stdout; - const status = spawnSync('git', ['status', '--porcelain', '-uall'], opts).stdout; - - const { objName, refName } = cleanBranchNames(branch); - const remote = cleanRemoteUrl(url); - const joiner = [version, remote, objName]; - const changed = getChanged(shortstat, status); - if (changed.hasChanged) { - joiner.push(changed.pretty); - } - joiner.push(refName); - const rv = { - version, - remote, - objName, - changed, - refName, - pretty: joiner.join(' | '), - }; - return rv; -} - -if (require.main === module) { - const vsn = getVersion(process.argv[2] || '.'); - process.stdout.write(JSON.stringify(vsn)); -} else { - module.exports = getVersion; -}