Skip to content

Conversation

vovaspace
Copy link
Collaborator

Changelog entry

Add a CI flow for Embedded UI refresh.

Changelog category

  • Not for changelog (changelog entry is not required)

Copy link

Hi! Thank you for contributing!
The tests on this PR will run after a maintainer adds an ok-to-test label to this PR manually. Thank you for your patience!

Comment on lines +27 to +28
ASSET_NAME: ${{ github.event.inputs && github.event.inputs.asset_name || github.event.client_payload.asset_name }}
REPOSITORY: ${{ github.event.inputs && github.event.inputs.repository || github.event.client_payload.repository }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will values form client_payload will ever be applied, while inputs.asset_name and inputs.repository have default values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default values are applied when triggering the worflow via GitHub UI (on the screenshot). When you triggers it via the repository_dispatch there is no github.event.inputs field at all.

image

mkdir $TARGET_DIR
mv -vf $TEMP_ASSET_DIR/$ASSET_NAME/* $TARGET_DIR

NEW_RESOURCES=$(find $TARGET_DIR -type f | grep -v '.map' | sort)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the initial instruction also *. LICENSE * files were excluded

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided that we need to keep these files in order to comply with all licenses.

Also I removed .map filter because there are no any source maps in the build.

delete-branch: true
title: "build: refresh Embedded UI (${{ env.TAG_NAME }})"
body: |
### Embedded UI Refresh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it be considered as a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that it won't, because it comes after |.

Comment on lines 50 to 57
INDENTATION=$(grep -e "$START_POINTER" $YA_MAKE_FILE | perl -lane 's/^(\s+)(.*)+$/$1/e; print')

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_FILE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add some comment, that will explain this script?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

- uses: actions/checkout@v4
- name: Asset Download
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Member

@artemmufazalov artemmufazalov Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between GITHUB_TOKEN and YDB_PLATFORM_BOT_TOKEN_REPO (used in ydb-embedded-ui workflows)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secrets.GITHUB_TOKEN is a default token that is provided by GitHub for any workflow. I found that it used also in docs_preview workflow.

No idea why secrets.GITHUB_TOKEN didn't use in ydb-embedded-ui for opening PRs.

@starlinskiy starlinskiy mentioned this pull request Feb 12, 2024
@vitstn vitstn mentioned this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants