Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
####################################################
#
# List of approvers for <project-name> project
# List of approvers for the Directory JavaScript SDK project
#
#####################################################
#
Expand All @@ -12,8 +12,8 @@
# the repository. Unless a later match takes precedence,
# the following users/teams will be requested for
# review when someone opens a pull request.
* @agntcy/<maintainer-team-name>
* @agntcy/dir-maintainers

# Enforces admin protections for repo configuration via probot settings app.
# ref: https://github.com/probot/settings#security-implications
.github/settings.yml @agntcy/<admin-team-name>
.github/settings.yml @agntcy/dir-maintainers
7 changes: 2 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ body:
If applicable, provide the version number or release tag where this
issue was encountered
options:
- v1.0.0
- v1.0.1
- v1.0.2
- v1.0.3
- v1.1.0
default: 0
validations:
required: false
Expand All @@ -55,7 +52,7 @@ body:
label: Checklist
description: By submitting this issue, you agree to the following
options:
- label: I have read the [contributing guidelines](/agntcy/repo-template/blob/main/CONTRIBUTING.md)
- label: I have read the [contributing guidelines](/agntcy/dir-sdk-javascript/blob/main/CONTRIBUTING.md)
required: true
- label: I have verified this does not duplicate an existing issue
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ body:
label: Checklist
description: By submitting this request, you agree to the following
options:
- label: I have read the [contributing guidelines](/agntcy/repo-template/blob/main/CONTRIBUTING.md)
- label: I have read the [contributing guidelines](/agntcy/dir-sdk-javascript/blob/main/CONTRIBUTING.md)
required: true
- label: |
I have verified this does not duplicate an existing feature request
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ much longer to review, or result in it not being reviewed at all.

## Checklist

- [ ] I have read the [contributing guidelines](/agntcy/repo-template/blob/main/CONTRIBUTING.md)
- [ ] I have read the [contributing guidelines](/agntcy/dir-sdk-javascript/blob/main/CONTRIBUTING.md)
- [ ] Existing issues have been referenced (where applicable)
- [ ] I have verified this change is not present in other open pull requests
- [ ] Functionality is documented
Expand Down
112 changes: 54 additions & 58 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ repository:
# See https://developer.github.com/v3/repos/#edit for all available settings.

# The name of the repository. Changing this will rename the repository
name: repo-template
name: dir-sdk-javascript

# A short description of the repository that will show up on GitHub
description: Agntcy Project Repo Template
description: Directory JavaScript SDK

# A URL with more information about the repository
homepage: https://www.example.com
homepage: https://docs.agntcy.org/dir/directory-sdk/#javascript-sdk

# A comma-separated list of topics to set on the repository
topics: github, probot
Expand Down Expand Up @@ -60,60 +60,56 @@ repository:

# TODO: Enable this section once GitHub teams have been created & granted access to this repository
# See https://developer.github.com/v3/teams/#add-or-update-team-repository for options
# teams:
# # The permission to grant the team. Can be one of:
# # * `pull` - can pull, but not push to or administer this repository.
# # * `push` - can pull and push, but not administer this repository.
# # * `admin` - can pull, push and administer this repository.
# # * `maintain` - Recommended for project managers who need to manage the
# # repository without access to sensitive or destructive actions.
# # * `triage` - Recommended for contributors who need to proactively manage
# # issues and pull requests without write access.
# - name: <project-name-admins>
# permission: admin
# - name: <project-name-maintainers>
# permission: maintain
# - name: <project-name>
# permission: triage
teams:
# The permission to grant the team. Can be one of:
# * `pull` - can pull, but not push to or administer this repository.
# * `push` - can pull and push, but not administer this repository.
# * `admin` - can pull, push and administer this repository.
# * `maintain` - Recommended for project managers who need to manage the
# repository without access to sensitive or destructive actions.
# * `triage` - Recommended for contributors who need to proactively manage
# issues and pull requests without write access.
- name: dir-maintainers
permission: admin

# TODO: Enable this section once repository has been created & no further modifications are needed
# branches:
# - name: main
# # https://developer.github.com/v3/repos/branches/#update-branch-protection
# # Branch Protection settings. Set to null to disable
# protection:
# # Required. Require at least one approving review on a pull request,
# # before merging. Set to null to disable.
# required_pull_request_reviews:
# # The number of approvals required. (1-6)
# required_approving_review_count: 1
# # Dismiss approved reviews automatically when a new commit is pushed.
# dismiss_stale_reviews: true
# # Blocks merge until code owners have reviewed.
# require_code_owner_reviews: true
# # Specify which users and teams can dismiss pull request reviews. Pass
# # an empty dismissal_restrictions object to disable. User and team
# # dismissal_restrictions are only available for organization-owned
# # repositories. Omit this parameter for personal repositories.
# dismissal_restrictions:
# users: []
# teams: []
# # Required. Require status checks to pass before merging. Set to null to disable
# required_status_checks:
# # Required. Require branches to be up to date before merging.
# strict: true
# # Required. The list of required status checks in order to merge into this branch
# contexts: []
# # Required. Enforce all configured restrictions for administrators. Set to
# # true to enforce required status checks for repository administrators.
# # Set to null to disable.
# enforce_admins: true
# # Prevent merge commits from being pushed to matching branches
# required_linear_history: true
# # Required. Restrict who can push to this branch. Team and user
# # restrictions are only available for organization-owned repositories. Set
# # to null to disable.
# restrictions:
# apps: []
# users: []
# teams: []
branches:
- name: main
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
# Required. Require at least one approving review on a pull request,
# before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 1
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: true
# Specify which users and teams can dismiss pull request reviews. Pass
# an empty dismissal_restrictions object to disable. User and team
# dismissal_restrictions are only available for organization-owned
# repositories. Omit this parameter for personal repositories.
dismissal_restrictions:
users: []
teams: []
# Required. Require status checks to pass before merging. Set to null to disable
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of required status checks in order to merge into this branch
contexts: []
# Required. Enforce all configured restrictions for administrators. Set to
# true to enforce required status checks for repository administrators.
# Set to null to disable.
enforce_admins: true
# Prevent merge commits from being pushed to matching branches
required_linear_history: true
# Required. Restrict who can push to this branch. Team and user
# restrictions are only available for organization-owned repositories. Set
# to null to disable.
restrictions:
apps: []
users: []
teams: []
87 changes: 87 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0

name: CI

on:
push:
branches:
- main
tags:
- "v*.*.*"
pull_request:

permissions:
contents: write
packages: write
id-token: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
code: ${{ steps.result.outputs.code }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check for code changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
filters: |
code:
- '!docs/**'
- '!README.md'
- '!CHANGELOG.md'
- '!CONTRIBUTING.md'
- '!CODE_OF_CONDUCT.md'
- '!SECURITY.md'
- '!LICENSE.md'
- '!MAINTAINERS.md'
- '!CONTRIBUTORS.md'
- '!AUTHZ.md'
- '!API_SPEC.md'
- '!RELEASE.md'
- '!.gitignore'

- name: Determine result
id: result
run: |
# Always run for tag pushes (releases), otherwise use paths-filter result
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
echo "code=true" >> $GITHUB_OUTPUT
else
echo "code=${{ steps.filter.outputs.code }}" >> $GITHUB_OUTPUT
fi

test:
name: Test
needs:
- changes
uses: ./.github/workflows/reusable-test-sdk.yaml
with:
image_repo: ghcr.io/agntcy
image_tag: ${{ github.sha }}

success:
name: Success
if: ${{ !cancelled() && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') }}
needs:
- changes
- test
runs-on: ubuntu-latest
steps:
- name: Echo Success
run: |
if [[ "${{ needs.changes.outputs.code }}" == "true" ]]; then
echo "::notice Success! All code checks passed."
else
echo "::notice Success! No code changes detected, skipped builds and tests."
fi
9 changes: 5 additions & 4 deletions .github/workflows/dependency.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: dependency

on:
# Review dependencies on pull requests to the default branch
pull_request:
branches: ["main"]
# TODO: enable dependency review after migration
# on:
# Review dependencies on pull requests to the default branch
# pull_request:
# branches: ["main"]

# Declare default permissions as read-only
permissions: read-all
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
name: lint

on:
push:
# Run superlinter on pushes to default branch
branches:
- main
# Run superlinter on pull request events
pull_request:
# TODO: enable linter after migration
# on:
# push:
# # Run superlinter on pushes to default branch
# branches:
# - main
# # Run superlinter on pull request events
# pull_request:

# Declare default permissions as read-only
permissions: read-all
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/reusable-test-sdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0

name: Test SDK

on:
workflow_call:
inputs:
image_repo:
required: true
type: string
description: "Image repo to use."
image_tag:
required: true
type: string
description: "Image tag to use."

permissions:
id-token: write
contents: read

jobs:
javascript:
name: JavaScript
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Login to ghcr.io
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: notused
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install Task
uses: go-task/setup-task@3be4020d41929789a01026e0e427a4321ce0ad44 #v2.0.0

- name: Setup Node env
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "24.x"
registry-url: https://registry.npmjs.org/
scope: "@agntcy"

- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: tmp/artifacts
merge-multiple: true

- name: Cache npm dependencies
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: "~/.npm"
key: node-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node-${{ runner.os }}-

- name: Add dependencies for SDKs testing
env:
CLIENT_ID: "https://github.com/${{ github.repository }}/.github/workflows/reusable-test-sdk.yaml@${{ github.ref }}"
run: |
task sdk:deps:cicd:iodc-token-generation >> $GITHUB_ENV

- name: Test JavaScript SDK
env:
CHART_VERSION: "0.0.0-latest"
IMAGE_TAG: latest
run: |
task sdk:test:javascript
Loading
Loading