Skip to content

Commit

Permalink
Migrate gantt chart to OpenSearch Dashboards 1.15 (#1)
Browse files Browse the repository at this point in the history
* Refactor gantt chart for opensearch

* bump to opensearch 1.15

* Update github workflows and readme to opensearch

* More renaming

* Rename repo in configs

* Remove opendistro in dashboards visualizations

* Update documents for repo

* Address comments
  • Loading branch information
joshuali925 authored Apr 16, 2021
1 parent 2cf95b1 commit 08ebff1
Show file tree
Hide file tree
Showing 23 changed files with 204 additions and 91 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Plugins**
Please list all plugins currently enabled.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Host/Environment (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🎆 Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
28 changes: 14 additions & 14 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- 'v*'

env:
PLUGIN_NAME: opendistroGanttChartKibana
OD_VERSION: 1.13.0.0
PLUGIN_NAME: ganttchartDashboards
OD_VERSION: 1.15.0.0

jobs:

Expand All @@ -28,13 +28,12 @@ jobs:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout Kibana
- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
with:
repository: opendistro-for-elasticsearch/kibana-oss
ref: 7.10.2
token: ${{secrets.OD_ACCESS}}
path: kibana-visualizations/kibana
repository: opensearch-project/Opensearch-Dashboards
ref: 1.x
path: dashboards-visualizations/OpenSearch-Dashboards

- name: Setup Node
uses: actions/setup-node@v1
Expand All @@ -43,27 +42,28 @@ jobs:

- name: Move Gantt Chart to Plugins Dir
run: |
mv gantt-chart kibana/plugins
mv gantt-chart OpenSearch-Dashboards/plugins
- name: Kibana Pluign Bootstrap
- name: Plugin Bootstrap
run: |
cd kibana/plugins/gantt-chart
yarn kbn bootstrap
cd OpenSearch-Dashboards/plugins/gantt-chart
yarn osd bootstrap
- name: Build Artifact
run: |
cd kibana/plugins/gantt-chart
cd OpenSearch-Dashboards/plugins/gantt-chart
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
- name: Upload to S3
run: |
cd kibana/plugins/gantt-chart
cd OpenSearch-Dashboards/plugins/gantt-chart
artifact=`ls ./build/*.zip`
# inject build number before the suffix
zip_outfile=`basename ${artifact%.zip}-build-${GITHUB_RUN_NUMBER}.zip`
# TODO update s3 bucket
s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/kibana-plugins/gantt-chart/"
echo "Copying ${artifact} to ${s3_prefix}${zip_outfile}"
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Test and Build Gantt Chart
on: [pull_request, push]

env:
PLUGIN_NAME: opendistroGanttChartKibana
OD_VERSION: 1.13.0.0
PLUGIN_NAME: ganttchartDashboards
OD_VERSION: 1.15.0.0

jobs:

Expand All @@ -16,30 +16,30 @@ jobs:
steps:
- name: Checkout Plugin
uses: actions/checkout@v1
- name: Checkout Kibana
- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
with:
repository: elastic/kibana
ref: v7.10.2
path: kibana-visualizations/kibana
repository: opensearch-project/Opensearch-Dashboards
ref: 1.x
path: dashboards-visualizations/OpenSearch-Dashboards
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.23.1'
- name: Move Gantt Chart to Plugins Dir
run: |
mv gantt-chart kibana/plugins
- name: Kibana Plugin Bootstrap
mv gantt-chart OpenSearch-Dashboards/plugins
- name: Plugin Bootstrap
run: |
cd kibana/plugins/gantt-chart
yarn kbn bootstrap
cd OpenSearch-Dashboards/plugins/gantt-chart
yarn osd bootstrap
- name: Build Artifact
run: |
cd kibana/plugins/gantt-chart
cd OpenSearch-Dashboards/plugins/gantt-chart
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: gantt-chart
path: kibana/plugins/gantt-chart/build
path: OpenSearch-Dashboards/plugins/gantt-chart/build
29 changes: 25 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.

This code of conduct applies to all spaces provided by the OpenSource project including in code, documentation, issue trackers, mailing lists, chat channels, wikis, blogs, social media and any other communication channels used by the project.


**Our open source communities endeavor to:**

* Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language.
* Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute.
* Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated.
* Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work.


**Our Responsibility. As contributors, members, or bystanders we each individually have the responsibility to behave professionally and respectfully at all times. Disrespectful and unacceptable behaviors include, but are not limited to:**

* The use of violent threats, abusive, discriminatory, or derogatory language;
* Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
* Posting of sexually explicit or violent content;
* The use of sexualized language and unwelcome sexual attention or advances;
* Public or private harassment of any kind;
* Publishing private information, such as physical or electronic address, without permission;
* Other conduct which could reasonably be considered inappropriate in a professional setting;
* Advocating for or encouraging any of the above behaviors.
* Enforcement and Reporting Code of Conduct Issues:

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported. [Contact us](mailto:[email protected]). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
28 changes: 27 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -173,3 +172,30 @@
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
7 changes: 7 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Dashboards Visualizations Maintainers

## Maintainers
| Maintainer | GitHub ID | Affiliation |
|------------------------|---------------------------------------------------|-------------|
| David Cui | [davidcui-amzn](https://github.com/davidcui-amzn) | Amazon |
| Joshua Li | [joshuali925](https://github.com/joshuali925) | Amazon |
13 changes: 12 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
OpenSearch
Copyright 2021 OpenSearch Contributors

This product includes software developed by
Elasticsearch (http://www.elastic.co).
Copyright 2009-2018 Elasticsearch

This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).

This product includes software developed by
Joda.org (http://www.joda.org/).
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# Open Distro for Elasticsearch Kibana Visualizations
# OpenSearch Dashboards Visualizations

The Open Distro for Elasticsearch Kibana Visualizations enables you to use additional types of visualizations inside Kibana Visualize and integrate them in Kibana Dashboard.
The OpenSearch Dashboards Visualizations enables you to use additional types of visualizations inside OpenSearch Dashboards Visualize and integrate them in Dashboard.


## Documentation

Please see our technical [documentation](https://opendistro.github.io/for-elasticsearch-docs/) to learn more about its features.
Please see our technical [documentation](https://opendistro.github.io/for-elasticsearch-docs/docs/kibana/gantt/) to learn more about its features.


## Setup

1. Download Elasticsearch for the version that matches the [Kibana version specified in package.json](./package.json#L5).
1. Download the Kibana source code for the [version specified in package.json](./package.json#L5) you want to set up.
1. Download OpenSearch for the version that matches the [OpenSearch Dashboards version specified in package.json](./package.json#L5).
1. Download the OpenSearch Dashboards source code for the [version specified in package.json](./package.json#L5) you want to set up.

See the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment) for more instructions on setting up your development environment.

1. Change your node version to the version specified in `.node-version` inside the Kibana root directory.
1. cd into the Kibana source code directory.
1. Change your node version to the version specified in `.node-version` inside the OpenSearch Dashboards root directory.
1. cd into the OpenSearch Dashboards source code directory.
1. Check out this package from version control into the `plugins` directory.
```
rm plugins -r
git clone [email protected]:opendistro-for-elasticsearch/kibana-visualizations.git plugins --no-checkout
git clone [email protected]:opensearch-project/dashboards-visualizations.git plugins --no-checkout
cd plugins
echo 'gantt-chart/*' >> .git/info/sparse-checkout
git config core.sparseCheckout true
git checkout main
```
6. Run `yarn kbn bootstrap` inside `kibana` directory.
6. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards` directory.

Ultimately, your directory structure should look like this:

```md
.
├── kibana
├── OpenSearch Dashboards
│ └── plugins
│ └── gantt-chart
```
Expand All @@ -42,29 +40,27 @@ Ultimately, your directory structure should look like this:

To build the plugin's distributable zip simply run `yarn build`.

Example output: `./build/opendistroGanttChartKibana-*.zip`
Example output: `./build/ganttchartDashboards*.zip`


## Run

- `yarn start`

Starts Kibana and includes this plugin. Kibana will be available on `localhost:5601`.
Starts OpenSearch Dashboards and includes this plugin. OpenSearch Dashboards will be available on `localhost:5601`.

- `npx cypress run`

Runs the plugin cypress tests.


## Contributing to Open Distro for Elasticsearch Kibana Visualizations
## Contributing to OpenSearch Dashboards Visualizations

We welcome you to get involved in development, documentation, testing the kibana reports plugin. See our [CONTRIBUTING.md](./CONTRIBUTING.md) and join in.

Since this is a Kibana plugin, it can be useful to review the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) alongside the documentation around [Kibana plugins](https://www.elastic.co/guide/en/kibana/master/kibana-plugins.html) and [plugin development](https://www.elastic.co/guide/en/kibana/current/plugin-development.html).
We welcome you to get involved in development, documentation, testing the visualizations plugin. See our [CONTRIBUTING.md](./CONTRIBUTING.md) and join in.

## Bugs, Enhancements or Questions

Please file an issue to report any bugs you may find, enhancements you may need or questions you may have [here](https://github.com/opendistro-for-elasticsearch/kibana-visualizations/issues).
Please file an issue to report any bugs you may find, enhancements you may need or questions you may have [here](https://github.com/opensearch-project/dashboards-visualizations/issues).

## License

Expand Down
8 changes: 4 additions & 4 deletions gantt-chart/.cypress/integration/ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { delay, GANTT_VIS_NAME, Y_LABEL, X_LABEL, DEFAULT_SIZE } from '../utils/

describe('Save a gantt chart', () => {
beforeEach(() => {
cy.visit(`${Cypress.env('kibana')}/app/visualize#`);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/visualize#`);
cy.wait(delay * 5);
});

Expand All @@ -45,7 +45,7 @@ describe('Save a gantt chart', () => {

describe('Render and configure a gantt chart', () => {
beforeEach(() => {
cy.visit(`${Cypress.env('kibana')}/app/visualize#`);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/visualize#`);
cy.wait(delay * 5);
cy.get('button').contains(GANTT_VIS_NAME).click({ force: true });
cy.wait(delay * 5);
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('Render and configure a gantt chart', () => {

describe('Configure panel settings', () => {
beforeEach(() => {
cy.visit(`${Cypress.env('kibana')}/app/visualize#`);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/visualize#`);
cy.wait(delay * 5);
cy.get('button').contains(GANTT_VIS_NAME).click({ force: true });
cy.wait(delay * 5);
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('Configure panel settings', () => {

describe('Add gantt chart to dashboard', () => {
it('Adds gantt chart to dashboard', () => {
cy.visit(`${Cypress.env('kibana')}/app/dashboards#/create`);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/dashboards#/create`);
cy.wait(delay * 5);

cy.get('.euiLink').contains('Add an existing').click({ force: true });
Expand Down
Loading

0 comments on commit 08ebff1

Please sign in to comment.