Skip to content

Developer Tips

Артём Муфазалов edited this page Feb 24, 2026 · 9 revisions

Tracing

To add tracing to all requests you should write in browser console:

localStorage.enable_tracing_for_all_requests = "true"

It will add X-Want-Trace: 1 header to all requests. Tracing data will be in Traceresponse response header

Making a hotfix version

Instruction if you don't want to merge common release from the main branch, but want to make a hotfix to a current tag.

Possible scenario: you have a big release with many changes in the main branch, but you want to make a new tag and npm package with some little fix.

  1. Select a tag you want to add hotfix to:
git checkout v6.30.0
  1. Create new branch from this tag. Name the branch with following pattern: hotfix/<tag-name>, otherwise release-please workflow won't see your branch
git checkout -b hotfix/v6.30.0
  1. Cherry pick needed commits from the main branch or create new commits. Name new commits according to conventional commits so they appear in the hotfix changelog
  2. Create commit with correct release tag in release-please-config.json. Name release tag with following pattern: <tag-name>-hotfix.<hotfix-number>
{
  // Some general settings
  "packages": {
    ".": {
      "release-as": "6.30.0-hotfix.1" // The string you need to add
    }
  }
}

  1. Push branch to origin. Release PR will be created automatically
  2. Merge release PR, new tag and npm package version will be created

Refresh Embedded UI inside YDB

Workflow: https://github.com/ydb-platform/ydb/blob/main/.github/workflows/embedded_ui_refresh.yaml

  1. Go to ydb-platform/ydb
  2. Go to Actions tab and select Embedded UI Refresh workflow
  3. Click run workflow button
  4. Fill ydb branch and UI release tag
  5. Run workflow, it will create update PR
  6. Request review from ui-backend team
  7. Merge PR when it is approved

⚠️ Workflow works only with one branch at a time, if you want to update UI in several ydb branches, run workflow for another branch only after update PR is merged.

Manual UI refresh in YDB

Release branches are protected and sometimes you cannot update them with GitHub action.

  1. Create release in ydb-ui (hotfix or normal release)
  2. Create ydb fork
  3. Fetch release branch
  4. Create some file like update.sh with script below in ydb root
  5. Write needed version to TAG variable in file
  6. Run file with bash update.sh
  7. Push changes
  8. Create PR

update.sh file

TAG="v14.1.0-hotfix.1"

ASSET_DIR="monitoring"
START_POINTER="# GENERATED MONITORING RESOURCES START"
END_POINTER="# GENERATED MONITORING RESOURCES END"
WORKING_DIR="./ydb/core/viewer"

# Clone, checkout to needed tag, create new branch
git clone https://github.com/ydb-platform/ydb-embedded-ui.git
cd ydb-embedded-ui/
git checkout $TAG

# Install deps and build
npm ci
npm run build:embedded:archive

# Return to ydb main dir
cd ..

# Prepare files
cp ./ydb-embedded-ui/embedded-ui.zip .
unzip embedded-ui.zip

# Setup dirs, move files
rm -rf $WORKING_DIR/$ASSET_DIR
mkdir $WORKING_DIR/$ASSET_DIR
mv -vf embedded-ui/* $WORKING_DIR/$ASSET_DIR
cd $WORKING_DIR

# List of files in the target directory.
NEW_RESOURCES=$(find $ASSET_DIR -type f | sort)
          
# Current indentation of the start pointer line.
INDENTATION=$(grep -e "$START_POINTER" ya.make | perl -lane 's/^(\s+)(.*)+$/$1/e; print')
          
# Replacing resources list between start and end pointers with saving the current indentation.
perl -0777 -pi -e "s/\s+$START_POINTER.*$END_POINTER/
$INDENTATION$START_POINTER
${INDENTATION}RESOURCE(
$(echo "$NEW_RESOURCES" | perl -e "while (<>) {chomp; print \"$INDENTATION    \$_ \$_\\n\";}" | sed -E 's/\//\\\//g')
$INDENTATION)
$INDENTATION$END_POINTER/s" ya.make

# Commit files
cd -
git add ./ydb/core/viewer/*
git commit -m "build: refresh Embedded UI $TAG"

# Cleanup
rm -rf ydb-embedded-ui
rm embedded-ui.zip

Manual UI refresh in YDB EM

Process is mostly similar to Manual UI refresh in YDB.

Build EM UI files with command npm run build:em:archive, copy archive to ydb-em directory root.

Run script bellow, checkout to desired branch and commit changes.

ASSET_DIR="ui"
START_POINTER="# GENERATED UI RESOURCES START"
END_POINTER="# GENERATED UI RESOURCES END"
WORKING_DIR="./ydb/ydb/meta/content"

# Prepare files
unzip embedded-ui.zip

# Setup dirs, move files
rm -rf $WORKING_DIR/$ASSET_DIR
mkdir $WORKING_DIR/$ASSET_DIR
mv -vf embedded-ui/* $WORKING_DIR/$ASSET_DIR
cd $WORKING_DIR

# List of files in the target directory.
NEW_RESOURCES=$(find $ASSET_DIR -type f | sort)

# Indentation from the start pointer line
INDENTATION=$(grep -e "$START_POINTER" ya.make | perl -lane 'print $1 if /^(\s+)/')

# Replacing resources list between start and end pointers. Each line: indent path /content/path
perl -0777 -pi -e "s/\s+$START_POINTER.*$END_POINTER/
${INDENTATION}$START_POINTER
$(echo "$NEW_RESOURCES" | perl -e "while (<>) {chomp; print \"${INDENTATION}\$_ /content/\$_\\n\";}" | sed -E 's/\//\\\//g')
${INDENTATION}$END_POINTER/s" ya.make

# Stage files
cd -
git add $WORKING_DIR

# # Cleanup
rm -rf ydb-embedded-ui

Check UI version inside YDB

If you have running ydb, you can check version in Embedded UI in Settings -> About

Screenshot 2024-12-20 at 15 37 22

To check UI version inside some ydb tag without running ydb, look at the last UI update commit.

  1. Go to https://github.com/ydb-platform/ydb/tree/main/ydb/core/viewer/monitoring
  2. Select ydb release branch
  3. Check UI version in the last update commit, it will be named in format build: refresh Embedded UI (vN.N.N)
Screenshot 2024-12-20 at 15 34 25

Clone this wiki locally