Skip to content

Commit

Permalink
Merge branch 'opensearch-project:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
junqiu-lei authored Sep 1, 2023
2 parents 44dcc58 + a78c23b commit f91b2b8
Show file tree
Hide file tree
Showing 123 changed files with 8,183 additions and 1,572 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams
* @opensearch-project/dashboards-maps
# This should match the list in MAINTAINERS.md.
* @heemin32 @navneet1v @VijayanB @vamshin @jmazanec15 @naveentatikonda @junqiu-lei @martin-gaievski
19 changes: 19 additions & 0 deletions .github/workflows/add-untriaged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Apply 'untriaged' label during issue lifecycle

on:
issues:
types: [opened, reopened, transferred]

jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['untriaged']
})
28 changes: 28 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Releases

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- uses: actions/checkout@v2
- uses: ncipollo/release-action@v1
with:
github_token: ${{ steps.github_app_token.outputs.token }}
bodyFile: release-notes/opensearch-dashboards-maps.release-notes-${{steps.tag.outputs.tag}}.md
18 changes: 18 additions & 0 deletions .github/workflows/changelog_verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Changelog Verifier"
on:
pull_request:
types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces the update of a changelog file on every pull request
verify-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.sha }}

- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: "autocut, skip-changelog"
28 changes: 13 additions & 15 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,23 +76,22 @@ jobs:
ref: ${{ env.OPENSEARCH_DASHBOARDS_BRANCH }}
path: OpenSearch-Dashboards

- name: Get node and yarn versions
id: versions_step
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
- name: Setup node
uses: actions/setup-node@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions_step.outputs.node_version }}
node-version-file: './OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Install correct yarn version for OpenSearch Dashboards
- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v

- name: Set npm to use bash for shell
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -115,15 +114,14 @@ jobs:
yarn start --no-base-path --no-watch &
shell: bash

# Window is slow so wait longer
- name: Sleep until OSD server starts - windows
if: ${{ matrix.os == 'windows-latest' }}
run: Start-Sleep -s 600
shell: powershell

- name: Sleep until OSD server starts - non-windows
if: ${{ matrix.os != 'windows-latest' }}
run: sleep 400
run: sleep 600
shell: bash

- name: Install Cypress
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,22 @@ jobs:
ref: ${{ env.OPENSEARCH_DASHBOARDS_BRANCH }}
path: OpenSearch-Dashboards

- name: Get node and yarn versions
id: versions_step
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
- name: Setup node
uses: actions/setup-node@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions_step.outputs.node_version }}
node-version-file: './OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Install correct yarn version for OpenSearch Dashboards
- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v

- name: Move plugin to OpenSearch-Dashboard Plugins Directory
run: mv dashboards-maps OpenSearch-Dashboards/plugins/dashboards-maps
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ node_modules/
target/
build/
coverage/
cypress/videos/
cypress/screenshots/
yarn-error.log
.DS_Store
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# CHANGELOG
All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See the [CONTRIBUTING guide](./CONTRIBUTING.md#Changelog) for instructions on how to add changelog entries.

## [Unreleased 3.0](https://github.com/opensearch-project/dashboards-maps/compare/2.x...HEAD)
### Features
### Enhancements
### Bug Fixes
### Infrastructure
### Documentation
### Maintenance
### Refactoring

## [Unreleased 2.x](https://github.com/opensearch-project/dashboards-maps/compare/2.9...2.x)
### Features
* Allow filtering geo_shape fields around map extent ([#452](https://github.com/opensearch-project/dashboards-maps/pull/452))
* Support dark mode in maps-dashboards([#455](https://github.com/opensearch-project/dashboards-maps/pull/455))

### Enhancements

### Bug Fixes

### Infrastructure

### Documentation

### Maintenance

### Refactoring
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Contributing Code](#contributing-code)
- [Developer Certificate of Origin](#developer-certificate-of-origin)
- [License Headers](#license-headers)
- [Changelog](#changelog)
- [Review Process](#review-process)

## Contributing to OpenSearch
Expand Down Expand Up @@ -115,6 +116,42 @@ New files in your code contributions should contain the following license header
# SPDX-License-Identifier: Apache-2.0
```

## Changelog

OpenSearch maintains version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep A Changelog](https://keepachangelog.com/en/1.0.0/) format. The purpose of the changelog is for the contributors and maintainers to incrementally build the release notes throughout the development process to avoid a painful and error-prone process of attempting to compile the release notes at release time. On each release the "unreleased" entries of the changelog are moved to the appropriate release notes document in the `./release-notes` folder. Also, incrementally building the changelog provides a concise, human-readable list of significant features that have been added to the unreleased version under development.

### Which changes require a CHANGELOG entry?
Changelogs are intended for operators/administrators, developers integrating with libraries and APIs, and end-users interacting with OpenSearch Dashboards and/or the REST API (collectively referred to as "user"). In short, any change that a user of OpenSearch might want to be aware of should be included in the changelog. The changelog is _not_ intended to replace the git commit log that developers of OpenSearch itself rely upon. The following are some examples of changes that should be in the changelog:

- A newly added feature
- A fix for a user-facing bug
- Dependency updates
- Fixes for security issues

The following are some examples where a changelog entry is not necessary:

- Adding, modifying, or fixing tests
- An incremental PR for a larger feature (such features should include _one_ changelog entry for the feature)
- Documentation changes or code refactoring
- Build-related changes

Any PR that does not include a changelog entry will result in a failure of the validation workflow in GitHub. If the contributor and maintainers agree that no changelog entry is required, then the `skip-changelog` label can be applied to the PR which will result in the workflow passing.

### How to add my changes to [CHANGELOG](CHANGELOG.md)?

Adding in the change is two step process:
1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR
2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there.

### Where should I put my CHANGELOG entry?
Please review the [branching strategy](https://github.com/opensearch-project/.github/blob/main/RELEASING.md#opensearch-branching) document. The changelog on the `main` branch will contain sections for the _next major_ and _next minor_ releases. Your entry should go into the section it is intended to be released in. In practice, most changes to `main` will be backported to the next minor release so most entries will likely be in that section.

The following examples assume the _next major_ release on main is 3.0, then _next minor_ release is 2.5, and the _current_ release is 2.4.

- **Add a new feature to release in next minor:** Add a changelog entry to `[Unreleased 2.x]` on main, then backport to 2.x (including the changelog entry).
- **Introduce a breaking API change to release in next major:** Add a changelog entry to `[Unreleased 3.0]` on main, do not backport.
- **Upgrade a dependency to fix a CVE:** Add a changelog entry to `[Unreleased 2.x]` on main, then backport to 2.x (including the changelog entry), then backport to 2.4 and ensure the changelog entry is added to `[Unreleased 2.4.1]`.

## Review Process

We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction.
Expand Down
68 changes: 40 additions & 28 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

So you want to contribute code to this project? Excellent! We're glad you're here. Here's what you need to do.

- [Forking and Cloning](#forking-and-cloning)
- [Forking](#forking)
- [Install Prerequisites](#install-prerequisites)
- [Setup](#setup)
- [Run](#run)
- [Build](#build)
- [Test](#test)
- [Submitting Changes](#submitting-changes)
- [Backports](#backports)

### Forking and Cloning
### Forking

Fork this repository on GitHub, and clone locally with `git clone`.
Fork the repository on GitHub.

### Install Prerequisites

Expand All @@ -21,50 +22,61 @@ You will need to install [node.js](https://nodejs.org/en/), [nvm](https://github

### Setup

1. Download the OpenSearch Dashboards source code for the [version specified in package.json](./src/plugins/custom_import_map/package.json#L3) you want to set up.
2. Change your node version to the version specified in `.node-version` inside the OpenSearch Dashboards root directory.
3. Create a `plugins` directory inside the OpenSearch Dashboards source code directory, if `plugins` directory doesn't exist.
4. cd into `plugins` directory in the OpenSearch Dashboards source code directory.
5. Check out this package from version control into the `plugins` directory.
```bash
git clone [email protected]:opensearch-project/dashboards-maps.git plugins --no-checkout
cd plugins
echo 'src/plugins/custom_import_map/*' >> .git/info/sparse-checkout
git config core.sparseCheckout true
git checkout main
```
6. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/src/plugins/custom_import_map`.
1. Download OpenSearch [Geospatial](https://github.com/opensearch-project/geospatial) plugin, which requires same version with OpenSearch-Dashboard and dashboards-maps plugin.
2. Run `./gradlew run` under Geospatial plugin root path to start OpenSearch cluster.
3. Download the OpenSearch Dashboards source code for the version specified in package.json you want to set up.
4. Change your node version by `nvm use <version>`to the version specified in `.node-version` inside the OpenSearch Dashboards root directory.
5. Create a `plugins` directory inside the OpenSearch Dashboards source code directory, if `plugins` directory doesn't exist.
6. cd into `plugins` directory in the OpenSearch Dashboards source code directory.
7. Check out this package from version control into the `plugins` directory.
8. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/dashboards-maps` folder.

Ultimately, your directory structure should look like this:

```md
.
├── OpenSearch-Dashboards
── plugins
└── src/plugins/custom_import_map
── plugins
└── dashboards-maps
```

### Run

From OpenSearch-Dashbaords repo (root folder), run the following command -
- `yarn start`
From OpenSearch-Dashboards repo (root folder), the following commands start OpenSearch Dashboards and includes this plugin.

```
yarn osd bootstrap
yarn start --no-base-path
```

OpenSearch Dashboards will be available on `localhost:5601`.

### Build

Starts OpenSearch Dashboards and includes this plugin. OpenSearch Dashboards will be available on `localhost:5601`.
To build the plugin's distributable zip simply run `yarn build`.

Example output: ./build/customImportMapDashboards-1.0.0.0.zip

### Test

From custom_import_map folder running the following command runs the plugin unit tests -
From dashboards-maps folder running the following command runs the plugin unit tests:

#### Unit test
```
yarn test:jest
```

`yarn test:jest`
#### Integration Tests
Integration tests for this plugin are written using the Cypress test framework.
```
yarn run cypress run
```

### Submitting Changes

See [CONTRIBUTING](CONTRIBUTING.md).

### Backports

The Github workflow in [`backport.yml`](.github/workflows/backport.yml) creates backport PRs automatically when the original PR
with an appropriate label `backport <backport-branch-name>` is merged to main with the backport workflow run successfully on the
PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the
The GitHub backport workflow creates backport PRs automatically for PRs with label `backport <backport-branch-name>`. Label should be attached to the original PR, backport workflow starts when original PR merged to main branch. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the
backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR
to the `1.x` branch.
to the `1.x` branch.
16 changes: 13 additions & 3 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, see [CONTRIBUTING](CONTRIBUTING.md).

## Current Maintainers
| Maintainer | GitHub ID | Affiliation |
|-------------------------|-------------------------------------------------------|-------------|
| Heemin Kim | [heemin32](https://github.com/heemin32) | Amazon |
| Jack Mazanec | [jmazanec15](https://github.com/jmazanec15) | Amazon |
| Junqiu Lei | [junqiu-lei](https://github.com/junqiu-lei) | Amazon |
| Martin Gaievski | [martin-gaievski](https://github.com/martin-gaievski) | Amazon |
| Naveen Tatikonda | [naveentatikonda](https://github.com/naveentatikonda) | Amazon |
| Navneet Verma | [navneet1v](https://github.com/navneet1v) | Amazon |
| Vamshi Vijay Nakkirtha | [vamshin](https://github.com/vamshin) | Amazon |
| Vijayan Balasubramanian | [VijayanB](https://github.com/VijayanB) | Amazon |

## Emeritus

| Maintainer | GitHub ID | Affiliation |
| ----------------------- | ------------------------------------------- | ----------- |
|-------------------------|---------------------------------------------| ----------- |
| Shivam Dhar | [Shivamdhar](https://github.com/Shivamdhar) | Amazon |
| Vijayan Balasubramanian | [VijayanB](https://github.com/VijayanB) | Amazon |
| Vamshi Vijay Nakkirtha | [vamshin](https://github.com/vamshin) | Amazon |
2 changes: 1 addition & 1 deletion common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const configSchema = schema.object({
defaultValue: 'https://tiles.maps.opensearch.org/data/v1.json',
}),
opensearchVectorTileStyleUrl: schema.string({
defaultValue: 'https://tiles.maps.opensearch.org/styles/basic.json',
defaultValue: 'https://tiles.maps.opensearch.org/v3/manifest.json',
}),
opensearchVectorTileGlyphsUrl: schema.string({
defaultValue: 'https://tiles.maps.opensearch.org/fonts/{fontstack}/{range}.pbf',
Expand Down
Loading

0 comments on commit f91b2b8

Please sign in to comment.