Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a88b18e
fix issuer url
Jun 4, 2025
ef02897
Merge pull request #4083 from amvanbaren/fix-issuer-url
amvanbaren Jun 4, 2025
da1bc45
Add quote delimiters
Jun 23, 2025
f6bb329
Merge pull request #4210 from amvanbaren/quotes-namespace-name
amvanbaren Jun 23, 2025
1ec7206
Check if namespace exists
Jun 23, 2025
7f993a1
Merge pull request #4213 from amvanbaren/namespace-not-found
amvanbaren Jun 23, 2025
3c27a1a
test elasticsearch sort and category
Jun 25, 2025
113a6dc
Merge pull request #4229 from amvanbaren/test-6877cf4f
amvanbaren Jun 25, 2025
253e788
Test relevance sort script
Jun 25, 2025
9260616
Merge pull request #4231 from amvanbaren/test-e79d8dd5
amvanbaren Jun 25, 2025
6c553e2
Back to old relevance sorting
Jun 25, 2025
d41a61d
Merge pull request #4237 from amvanbaren/test-bb72e3e2
amvanbaren Jun 25, 2025
743278e
switch back to production version
Jun 25, 2025
a52e6c7
Merge pull request #4238 from amvanbaren/v0.26.0
amvanbaren Jun 25, 2025
aa634c8
Update application.yml to use prod as default
autumnfound Jun 26, 2025
3c28c8e
Check for ':' char
Jun 27, 2025
5d0f4db
Merge pull request #4254 from amvanbaren/namespace-claim-remove-not-p…
amvanbaren Jun 27, 2025
6ecbfa6
Update README.md
Olexandr88 Jun 27, 2025
adb6bf2
Add concurrency to workflow
Jun 28, 2025
630627b
Merge pull request #4265 from amvanbaren/namespace-claim-concurrency
amvanbaren Jun 28, 2025
aabac88
Merge pull request #4255 from Olexandr88/patch-1
amvanbaren Jun 28, 2025
8086e6a
Check issue is open before making changes
Jun 30, 2025
019114f
Merge pull request #4279 from amvanbaren/namespace-claim-issue-is-open
amvanbaren Jun 30, 2025
372eaa2
Claim namespace don't run on default title
Jul 4, 2025
8696716
Merge pull request #4329 from amvanbaren/claim-namespace-default-title
amvanbaren Jul 4, 2025
c1d87c5
Merge pull request #4248 from autumnfound/patch-1
amvanbaren Jul 4, 2025
871adb3
Reindex ElasticSearch
Jul 4, 2025
c022b05
Merge pull request #4332 from amvanbaren/elasticsearch-reindex
amvanbaren Jul 4, 2025
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
65 changes: 57 additions & 8 deletions .github/workflows/claim-namespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,34 @@ name: Claim Namespace
on:
issues:
types: [opened, edited, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: true
jobs:
namespace:
name: Namespace Claim Checks
runs-on: ubuntu-latest
permissions:
issues: write
if: ${{ contains(github.event.issue.labels.*.name, 'namespace') && !contains(github.event.issue.labels.*.name, 'granted') && !contains(github.event.issue.labels.*.name, 'denied') && startsWith(github.event.issue.title, 'Claiming namespace') }}
if: ${{ startsWith(github.event.issue.title, 'Claiming namespace') && github.event.issue.title != 'Claiming namespace [name]' && contains(github.event.issue.labels.*.name, 'namespace') && !contains(github.event.issue.labels.*.name, 'granted') && !contains(github.event.issue.labels.*.name, 'denied') }}
steps:
- id: get_namespace
name: Get namespace name
uses: actions/github-script@v7
with:
script: |
let namespace = context.payload.issue.title.substring('Claiming namespace'.length).trim();
if((namespace.startsWith('[') && namespace.endsWith(']')) || (namespace.startsWith('`') && namespace.endsWith('`'))) {
namespace = namespace.substring(1, namespace.length - 1);
let namespace = context.payload.issue.title.substring('Claiming namespace'.length);
if(namespace.startsWith(':')) {
namespace = namespace.substring(1);
}

namespace = namespace.trim();
const delimiters = [{start: '[', end: ']'}, {start: '`', end: '`'}, {start: '"', end: '"'}, {start: "'", end: "'"}];
for(const {start, end} of delimiters) {
if(namespace.startsWith(start) && namespace.endsWith(end)) {
namespace = namespace.substring(1, namespace.length - 1);
break;
}
}

if(!namespace) {
Expand All @@ -27,8 +39,35 @@ jobs:
}
- id: log_namespace
name: Log namespace name
run: echo "${{steps.get_namespace.outputs.namespace}}"
- id: get_namespace_data
run: echo '${{steps.get_namespace.outputs.namespace}}'
- id: api_get_namespace
name: Namespace API request
uses: JamesIves/fetch-api-data-action@v2
with:
endpoint: https://open-vsx.org/api/${{steps.get_namespace.outputs.namespace}}
configuration: '{ "method": "GET" }'
- id: namespace_not_found_should_close
if: ${{ failure() && steps.get_namespace.outputs.namespace != null }}
name: Check issue is still open before editing issue
uses: octokit/request-action@v2.x
with:
route: GET /repos/{repo}/issues/{issue_number}
repo: ${{ github.repository }}
issue_number: ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: namespace_not_found
if: ${{ failure() && fromJSON(steps.namespace_not_found_should_close.outputs.data).state == 'open' }}
run: |
gh issue edit "$NUMBER" --add-assignee "$ASSIGNEE"
gh issue close "$NUMBER" -c "The namespace '$NAMESPACE' doesn't exist. Please publish your extension first and then open a new namespace claim issue." -r "not planned"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
NAMESPACE: ${{ steps.get_namespace.outputs.namespace }}
ASSIGNEE: amvanbaren
- id: api_get_namespace_members
name: Namespace members API request
uses: JamesIves/fetch-api-data-action@v2
with:
Expand All @@ -37,7 +76,7 @@ jobs:
- id: namespace_members
uses: actions/github-script@v7
env:
DATA: ${{ steps.get_namespace_data.outputs.fetchApiData }}
DATA: ${{ steps.api_get_namespace_members.outputs.fetchApiData }}
with:
script: |
const json = JSON.parse(process.env.DATA);
Expand All @@ -52,9 +91,19 @@ jobs:
const members = JSON.parse(process.env.MEMBERS);
const makeOwner = members.length == 1 && members[0].user.loginName == process.env.LOGIN_NAME && members[0].role == 'contributor';
core.setOutput('makeOwner', makeOwner);
- id: should_change_member
if: ${{ steps.make_owner.outputs.makeOwner == 'true' }}
name: Check issue is still open before changing namespace membership
uses: octokit/request-action@v2.x
with:
route: GET /repos/{repo}/issues/{issue_number}
repo: ${{ github.repository }}
issue_number: ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: change_member
name: Namespace change member API request
if: ${{ steps.make_owner.outputs.makeOwner == 'true' }}
if: ${{ steps.make_owner.outputs.makeOwner == 'true' && fromJSON(steps.should_change_member.outputs.data).state == 'open' }}
uses: JamesIves/fetch-api-data-action@v2
with:
endpoint: https://open-vsx.org/admin/api/namespace/${{steps.get_namespace.outputs.namespace}}/change-member?user=${{github.event.issue.user.login}}&provider=github&role=owner&token=${{secrets.OPENVSX_TOKEN}}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ Have a bug or a feature request? Please search for existing and closed issues. I

## Copyright and license

Copyright 2021-2022 the [Eclipse Foundation, Inc.](https://www.eclipse.org) and the [open-vsx.org authors](https://github.com/eclipsefdn/open-vsx.org/graphs/contributors). Code released under the [Eclipse Public License Version 2.0 (EPL-2.0)](https://github.com/eclipsefdn/open-vsx.org/blob/src/LICENSE).
Copyright 2021-2022 the [Eclipse Foundation, Inc.](https://www.eclipse.org) and the [open-vsx.org authors](https://github.com/eclipsefdn/open-vsx.org/graphs/contributors). Code released under the [Eclipse Public License Version 2.0 (EPL-2.0)](https://github.com/EclipseFdn/open-vsx.org/blob/main/LICENSE).
8 changes: 3 additions & 5 deletions configuration/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ spring:
scope: openvsx_publisher_agreement, profile
provider:
eclipse:
authorization-uri: https://accounts.eclipse.org/oauth2/authorize
token-uri: https://accounts.eclipse.org/oauth2/token
user-info-uri: https://accounts.eclipse.org/oauth2/UserInfo
user-name-attribute: name
user-info-authentication-method: header
issuer-uri: https://auth.eclipse.org/auth/realms/community
user-name-attribute: preferred_username
management:
server:
port: 8081
Expand Down Expand Up @@ -174,6 +171,7 @@ ovsx:
elasticsearch:
enabled: true
ssl: true
clear-on-start: true
search:
relevance:
rating: 0.5
Expand Down
Loading