Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic product refresh after taxonomy deployment #11011

Open
teolemon opened this issue Nov 13, 2024 · 0 comments
Open

Automatic product refresh after taxonomy deployment #11011

teolemon opened this issue Nov 13, 2024 · 0 comments

Comments

@teolemon
Copy link
Member

teolemon commented Nov 13, 2024

Problem

  • fix: allow to query tags without normalization #11008 solves a very nice pain point on refreshing products after taxonomy update
  • Can you create a GitHub action that gathers all changed entries (take every modified line containing an entry with the en: prefix, an entry is each comma separated value in this line) in the files contained in the "taxonomies" folder, between 2 GitHub releases.
  • Automatically run the "update_all_products.sh" script with each modified tag as an argument

Pseudo code

name: Gather Changed Entries and Run Script

on:
  push:
    tags:
      - 'v*.*.*'

jobs:
  gather-changes:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v3

    - name: Get the latest two tags
      id: get-tags
      run: |
        latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
        previous_tag=$(git describe --tags `git rev-list --tags --skip=1 --max-count=1`)
        echo "::set-output name=latest_tag::$latest_tag"
        echo "::set-output name=previous_tag::$previous_tag"

    - name: Gather changes
      id: gather-changes
      run: |
        git diff ${{ steps.get-tags.outputs.previous_tag }} ${{ steps.get-tags.outputs.latest_tag }} -- taxonomies/ > changes.diff
        grep -E '^\+\s*.*en:' changes.diff > filtered_changes.txt
        tags=$(grep -o 'en:[^,]*' filtered_changes.txt | sort | uniq)
        echo "::set-output name=tags::$tags"

    - name: Run update_all_products.pl for each tag
      run: |
        for tag in ${{ steps.gather-changes.outputs.tags }}
        do
          ./scripts/update_all_products.pl --query categories_tags=en:some-old-entry-that-is-now-a-synonym!
        done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To discuss and validate
Development

No branches or pull requests

1 participant