Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/MCUsReleaseTest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ jobs:
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_INDEX_TEST: ${{ secrets.ES_INDEX_TEST }}
ES_INDEX_LIVE: ${{ secrets.ES_INDEX_LIVE }}
ES_INDEX_EXPERIMENTAL: ${{ secrets.ES_INDEX_EXPERIMENTAL }}
run: |
echo "Indexing to Test."
python -u scripts/index.py ${{ github.repository }} ${{ steps.app-token.outputs.token }} ${{ secrets.ES_INDEX_TEST }} ${{ secrets.PROG_DEBUG_CODEGRIP_LIVE }} "False" ${{ github.event.inputs.release_version }} "False" "False"
echo "Indexing to Experimental."
python -u scripts/index.py ${{ github.repository }} ${{ steps.app-token.outputs.token }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} ${{ secrets.PROG_DEBUG_CODEGRIP_LIVE }} "False" ${{ github.event.inputs.release_version }} "False" "False"

- name: Notify Mattermost - Test ready
env:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/checkIndexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ jobs:
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_LIVE }} "--es_regex" "${{ github.event.inputs.regex }}" "--log_only" "$LOG_ONLY" "--index_legacy_packages" "${{ github.event.inputs.index_legacy }}"
continue-on-error: true # Ensure the workflow continues

- name: Check Indexed Links - Experimental
if: ${{ github.event.inputs.select_index == 'Test' || github.event.inputs.select_index == 'Both' }}
run: |
FIX_ACTION=${{ github.event.inputs.fix }} # Capture the fix input
LOG_ONLY=$([[ "$FIX_ACTION" == "false" ]] && echo true || echo false) # Negate the fix input
echo "LOG_ONLY is set to $LOG_ONLY"
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} "--es_regex" "${{ github.event.inputs.regex }}" "--log_only" "$LOG_ONLY" "--index_legacy_packages" "${{ github.event.inputs.index_legacy }}"
continue-on-error: true # Ensure the workflow continues

- name: Check Indexed Links - Test
if: ${{ github.event.inputs.select_index == 'Test' || github.event.inputs.select_index == 'Both' }}
run: |
Expand Down Expand Up @@ -95,6 +104,11 @@ jobs:
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_LIVE }} "--es_regex" "$GLOBAL_REGEX"
continue-on-error: true # Ensure the workflow continues

- name: Check Indexed Links - Experimental
run: |
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} "--es_regex" "$GLOBAL_REGEX"
continue-on-error: true # Ensure the workflow continues

- name: Check Indexed Links - Test
run: |
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_TEST }} "--es_regex" "$GLOBAL_REGEX"
Expand Down Expand Up @@ -122,6 +136,11 @@ jobs:
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_LIVE }} "--es_regex" "$GLOBAL_REGEX"
continue-on-error: true # Ensure the workflow continues

- name: Check Indexed Links - Experimental
run: |
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} "--es_regex" "$GLOBAL_REGEX"
continue-on-error: true # Ensure the workflow continues

- name: Check Indexed Links - Test
run: |
python -u scripts/check_indexes.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_HOST }} ${{ secrets.ES_USER }} ${{ secrets.ES_PASSWORD }} ${{ secrets.ES_INDEX_TEST }} "--es_regex" "$GLOBAL_REGEX"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
echo "Promote to latest requested, but ignored. Only available for LIVE updates."
fi
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_TEST }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} ${{ github.event.inputs.force_index }} ${{ github.event.inputs.release_version }} False False "--keep_previous_dates" ${{ github.event.inputs.keep_dates }}
echo "Indexing to Experimental."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} ${{ github.event.inputs.force_index }} ${{ github.event.inputs.release_version }} False False "--keep_previous_dates" ${{ github.event.inputs.keep_dates }}
fi

- name: Send notification to Mattermost
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/releaseCodegripPackages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ jobs:
if [[ ${{ github.event.inputs.select_index }} == "Test" ]]; then
echo "Indexing to Test."
python -u scripts/index_codegrip_packages.py ${{ secrets.ES_INDEX_TEST }} ${{ secrets.PROG_DEBUG_CODEGRIP_LIVE }} ${{ github.event.inputs.start_date }} ${{ github.event.inputs.end_date }} > message.txt
echo "Indexing to Experimental."
python -u scripts/index_codegrip_packages.py ${{ secrets.ES_INDEX_EXPERIMENTAL }} ${{ secrets.PROG_DEBUG_CODEGRIP_LIVE }} ${{ github.event.inputs.start_date }} ${{ github.event.inputs.end_date }} > message.txt
else
echo "Indexing to Live."
python -u scripts/index_codegrip_packages.py ${{ secrets.ES_INDEX_LIVE }} ${{ secrets.PROG_DEBUG_CODEGRIP_LIVE }} ${{ github.event.inputs.start_date }} ${{ github.event.inputs.end_date }} > message.txt
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/updateDb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@ jobs:
else
echo "Indexing database to TEST."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_TEST }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} False ${{ github.event.inputs.release_version }} True False
echo "Indexing database to EXPERIMENTAL."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} False ${{ github.event.inputs.release_version }} True False
fi
2 changes: 2 additions & 0 deletions .github/workflows/updateDbDevices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ jobs:
if [[ ${{ steps.mikrosdk_payload.outputs.index }} == "Test" ]]; then
echo "Indexing database to TEST."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_TEST }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} "True" "latest" "True" "False"
echo "Indexing database to EXPERIMENTAL."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} "True" "latest" "True" "False"
fi
if [[ ${{ steps.mikrosdk_payload.outputs.index }} == "Live" ]]; then
echo "Indexing database to LIVE."
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/updateDbFromSdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_INDEX_TEST: ${{ secrets.ES_INDEX_TEST }}
ES_INDEX_LIVE: ${{ secrets.ES_INDEX_LIVE }}
ES_INDEX_EXPERIMENTAL: ${{ secrets.ES_INDEX_EXPERIMENTAL }}
run: |
if [[ ${{ steps.mikrosdk_payload.outputs.index }} == "Live" ]]; then
echo "Uploading and indexing to Live."
Expand Down Expand Up @@ -118,6 +119,8 @@ jobs:
if [[ ${{ steps.mikrosdk_payload.outputs.index }} == "Test" ]]; then
echo "Indexing database to TEST."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_TEST }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} "True" "latest" "True" "False"
echo "Indexing database to EXPERIMENTAL."
python -u scripts/index.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.ES_INDEX_EXPERIMENTAL }} ${{ secrets.PROG_DEBUG_CODEGRIP_TEST }} "True" "latest" "True" "False"
fi
if [[ ${{ steps.mikrosdk_payload.outputs.index }} == "Live" ]]; then
echo "Indexing database to LIVE."
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/updateSchemasAndClocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_INDEX_TEST: ${{ secrets.ES_INDEX_TEST }}
ES_INDEX_LIVE: ${{ secrets.ES_INDEX_LIVE }}
ES_INDEX_EXPERIMENTAL: ${{ secrets.ES_INDEX_EXPERIMENTAL }}
run: |
INDEX_TEST="True"
if [[ ${{ steps.determine-trigger.outputs.run_test }} == "False" ]]; then
Expand All @@ -87,7 +88,7 @@ jobs:
echo "Uploading and indexing to Live."
python -u scripts/update_schemas.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ steps.determine-trigger.outputs.run_version }} ${{ secrets.ES_INDEX_LIVE }} "$INDEX_TEST"
else
echo "Uploading and indexing to Test and Live."
echo "Uploading and indexing to Test, Experimental and Live."
python -u scripts/update_schemas.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ steps.determine-trigger.outputs.run_version }} ${{ secrets.ES_INDEX_TEST }} "$INDEX_TEST"
fi

Expand All @@ -98,6 +99,7 @@ jobs:
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
ES_INDEX_TEST: ${{ secrets.ES_INDEX_TEST }}
ES_INDEX_LIVE: ${{ secrets.ES_INDEX_LIVE }}
ES_INDEX_EXPERIMENTAL: ${{ secrets.ES_INDEX_EXPERIMENTAL }}
run: |
echo "Uploading and indexing to Test and Live."
echo "Uploading and indexing to Test, Experimental and Live."
python -u scripts/update_clocks.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} "latest"
2 changes: 1 addition & 1 deletion scripts/check_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def str2bool(v):
package_name = f'{indexed_item['source']['name']}.7z'
else:
package_name = f'{indexed_item['source']['name']}.json'
if indexed_item['source']['name'] == 'database' and 'test' in args.es_index:
if indexed_item['source']['name'] == 'database' and ('test' in args.es_index or 'experimental' in args.es_index):
package_name = 'database_dev.7z'
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have a separate name for experimental database?

# Set gh_package_name only for github assets
if 'gh_package_name' not in indexed_item['source'] and 'Device Pack' not in indexed_item['source']['category'] and indexed_item['source']['author'] not in thirdparty_authors:
Expand Down
7 changes: 5 additions & 2 deletions scripts/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai
package_name = name_without_extension
if 'database' in name_without_extension:
package_name = 'database'
if ('dev' in name_without_extension) and ('test' in index_name):
if ('dev' in name_without_extension) and ('test' in index_name or 'experimental' in index_name):
print("Database test version.")
elif ('dev' not in name_without_extension) and ('live' in index_name):
print("Database live version.")
Expand Down Expand Up @@ -481,11 +481,14 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai
print(f"{resp["result"]} {resp['_id']}")
# Database is indexed as separate ID for both indexes, so skip it in this step
if (name_without_extension in always_index) and ('database' not in name_without_extension):
if ('ES_INDEX_TEST' in os.environ) and ('ES_INDEX_LIVE' in os.environ):
if ('ES_INDEX_TEST' in os.environ) and ('ES_INDEX_LIVE' in os.environ) and ('ES_INDEX_EXPERIMENTAL' in os.environ):
if index_name == os.environ['ES_INDEX_TEST']:
resp = es.index(index=os.environ['ES_INDEX_LIVE'], doc_type=None, id=name_without_extension, body=doc)
print(f"Indexed to LIVE as well.")
print(f"{resp["result"]} {resp['_id']}")
resp = es.index(index=os.environ['ES_INDEX_EXPERIMENTAL'], doc_type=None, id=name_without_extension, body=doc)
print(f"Indexed to EXPERIMENTAL as well.")
print(f"{resp["result"]} {resp['_id']}")

# Print new version after indexing
if previous_version != doc['version'] and True == doc['package_changed']:
Expand Down
4 changes: 4 additions & 0 deletions scripts/update_clocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def index_clocks(es: Elasticsearch, release_details, version, current_hash):
resp = es.index(index=os.environ['ES_INDEX_TEST'], doc_type=None, id=f'clocks', body=doc)
print(f"{resp['result']} {resp['_id']}")

doc['_type'] = '_doc'
resp = es.index(index=os.environ['ES_INDEX_EXPERIMENTAL'], doc_type=None, id=f'clocks', body=doc)
print(f"{resp['result']} {resp['_id']}")

resp = es.index(index=os.environ['ES_INDEX_LIVE'], doc_type=None, id=f'clocks', body=doc)
print(f"{resp['result']} {resp['_id']}")

Expand Down
4 changes: 3 additions & 1 deletion scripts/update_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ def index_schemas(es: Elasticsearch, release_details, version, index_name, curre
print(f"{resp['result']} {resp['_id']}")

# Special case - update live index Elasticsearch base as well
if 'ES_INDEX_TEST' in os.environ and 'ES_INDEX_LIVE' in os.environ:
if 'ES_INDEX_TEST' in os.environ and 'ES_INDEX_LIVE' in os.environ and 'ES_INDEX_EXPERIMENTAL' in os.environ:
if index_name == os.environ['ES_INDEX_TEST']:
resp = es.index(index=os.environ['ES_INDEX_LIVE'], doc_type=None, id=f'schemas{test_version}', body=doc)
print(f"{resp['result']} {resp['_id']}")
resp = es.index(index=os.environ['ES_INDEX_EXPERIMENTAL'], doc_type=None, id=f'schemas{test_version}', body=doc)
print(f"{resp['result']} {resp['_id']}")

async def upload_asset(session, token, repo, tag_name, asset_path):
""" Upload a release asset to GitHub asynchronously """
Expand Down