From e9ff1895c961cee3772c0f1f3940ab04636b2391 Mon Sep 17 00:00:00 2001 From: Dhrubo Saha Date: Wed, 3 Apr 2024 12:18:36 -0700 Subject: [PATCH 1/3] updating hidden agent information (#6867) Signed-off-by: Dhrubo Saha --- _ml-commons-plugin/agents-tools/agents-tools-tutorial.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_ml-commons-plugin/agents-tools/agents-tools-tutorial.md b/_ml-commons-plugin/agents-tools/agents-tools-tutorial.md index 68d979d6d6..39051f399c 100644 --- a/_ml-commons-plugin/agents-tools/agents-tools-tutorial.md +++ b/_ml-commons-plugin/agents-tools/agents-tools-tutorial.md @@ -365,10 +365,11 @@ Only superadmin users can register a hidden agent. To register a hidden agent, y curl -k --cert ./kirk.pem --key ./kirk-key.pem -XGET 'https://localhost:9200/.opendistro_security/_search' ``` -All agents created by a superadmin user are automatically registered as hidden. To register a hidden agent, send a request to the `_register` endpoint: +All agents created by a superadmin user are automatically registered as hidden. Only the superadmin user can view hidden agent details and delete hidden agents. +To register a hidden agent, send a request to the `_register` endpoint: ```bash -curl -k --cert ./kirk.pem --key ./kirk-key.pem -X POST 'https://localhost:9200/_plugins/_ml/models/_register' -H 'Content-Type: application/json' -d ' +curl -k --cert ./kirk.pem --key ./kirk-key.pem -X POST 'https://localhost:9200/_plugins/_ml/agents/_register' -H 'Content-Type: application/json' -d ' { "name": "Test_Agent_For_RAG", "type": "flow", From afa4d2754a23cba4d7d92c6c5bc669561966977d Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 3 Apr 2024 16:11:06 -0400 Subject: [PATCH 2/3] Initial changes add backport automerge label (#6865) * Add a label to backport PRs in preparation for backport automerge Signed-off-by: Peter Zhu * Small tweaks Signed-off-by: Peter Zhu --------- Signed-off-by: Peter Zhu --- .github/workflows/backport.yml | 10 ++++++++++ .github/workflows/delete_merged_branch.yml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 8f933b2ada..6559b3b15b 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,6 +16,7 @@ jobs: # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. if: > github.event.pull_request.merged + && github.repository == 'opensearch-project/documentation-website' && ( github.event.action == 'closed' || ( @@ -38,3 +39,12 @@ jobs: with: github_token: ${{ steps.github_app_token.outputs.token }} head_template: backport/backport-<%= number %>-to-<%= base %> + + - name: Label new backport PR with backport-automerge label + run: | + PR_BRANCH=backport/backport-<%= number %>-to-<%= base %> + PR_NUMBER=`gh pr list -R opensearch-project/documentation-website --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"` + echo "Update Backport PR #$PR_NUMBER on branch $PR_BRANCH with backport-automerge label" + gh issue edit -R opensearch-project/documentation-website $PR_NUMBER --add-label backport-automerge + env: + GH_TOKEN: ${{ steps.github_app_token.outputs.token }} diff --git a/.github/workflows/delete_merged_branch.yml b/.github/workflows/delete_merged_branch.yml index a97d2674e4..f6fc3f2828 100644 --- a/.github/workflows/delete_merged_branch.yml +++ b/.github/workflows/delete_merged_branch.yml @@ -8,7 +8,7 @@ jobs: delete-branch: runs-on: ubuntu-latest if: | - startsWith(github.event.pull_request.head.repo.full_name, 'opensearch-project/documentation-website') && + github.repository == 'opensearch-project/documentation-website' && ${{ !startsWith(github.event.pull_request.head.ref, 'main') }} && ${{ !startsWith(github.event.pull_request.head.ref, '1.') }} && ${{ !startsWith(github.event.pull_request.head.ref, '2.') }} && From 801b6ec266e8bd9766f52917dff0d92ccae524de Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 3 Apr 2024 17:52:58 -0400 Subject: [PATCH 3/3] Tweak label creation logic on backport workflows (#6871) * Tweak label creation logic on backport workflows Signed-off-by: Peter Zhu * Tweak label creation logic on backport workflows Signed-off-by: Peter Zhu --------- Signed-off-by: Peter Zhu --- .github/workflows/backport.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 6559b3b15b..92f107839c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -42,9 +42,9 @@ jobs: - name: Label new backport PR with backport-automerge label run: | - PR_BRANCH=backport/backport-<%= number %>-to-<%= base %> + PR_BRANCH=backport/backport-${{ github.event.pull_request.number }}-to-`echo ${{ github.event.label.name }} | cut -d ' ' -f2` PR_NUMBER=`gh pr list -R opensearch-project/documentation-website --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"` - echo "Update Backport PR #$PR_NUMBER on branch $PR_BRANCH with backport-automerge label" + echo "Update Backport PR '#$PR_NUMBER' on branch '$PR_BRANCH' with 'backport-automerge' label" gh issue edit -R opensearch-project/documentation-website $PR_NUMBER --add-label backport-automerge env: - GH_TOKEN: ${{ steps.github_app_token.outputs.token }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}