Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiDataSource feature merge #2334

Merged
merged 54 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
9171a5d
Instantiate credential management plugin code structure (#1996)
noCharger Jul 28, 2022
b2ca14f
Data source inside stack management setup (#2017) (#2030)
kristenTian Aug 1, 2022
addbb10
enable CI for feature branch (#2010)
zhongnansu Aug 1, 2022
4737ba4
Add empty data source plugin (#2052)
zengyan-amazon Aug 2, 2022
1762412
[MD] Add initial credential management CRUD pages (#2040)
noCharger Aug 3, 2022
0f12808
Register Data source to savedObject & Update license header (#2037)
kristenTian Aug 3, 2022
3870b7d
Move credential saved object to data source plugin (#2062)
noCharger Aug 3, 2022
85906d9
breadcrumbfix for datasource management (#2066)
mpabba3003 Aug 4, 2022
420c118
Fix breadcrumb on listing page and update saved object mapping (#2069)
noCharger Aug 4, 2022
03fa1c5
Add data source step into IndexPattern with Mock switch (#2064) (#2086)
kristenTian Aug 9, 2022
2faa379
Add delete button for credential detailed page (#2067)
yibow98 Aug 9, 2022
0019d2d
Link datasource to indexpattern (#2118)
kristenTian Aug 10, 2022
72d9b1a
Add encrypt/decrypt module on data source plugin (#2120)
noCharger Aug 12, 2022
0a34341
Integrate index pattern with new data client (#2146)
kristenTian Aug 16, 2022
f6b9de6
Add noAuth to dataSource attributes (#2154)
kristenTian Aug 17, 2022
9f7c9b6
[MD] Datasource Management - creation & listing - UI only (#2128)
mpabba3003 Aug 17, 2022
71014a2
Apply dataSource plugin as dependent for cm and dsm plugins (#2150)
noCharger Aug 17, 2022
9ddb250
Leverage datasource enablement in index pattern management
kristenTian Aug 17, 2022
6f64642
[MD] Add client management module and register `getClient()` to route…
zhongnansu Aug 18, 2022
d41cf71
Make step info in index pattern creation dynamic (#2164)
kristenTian Aug 18, 2022
c7cd702
Refactor for credential listing page & add loading effect (#2142)
yibow98 Aug 18, 2022
5d4134e
Integration sequal - replace data client placeholders (#2167)
kristenTian Aug 18, 2022
0ca5bb1
Integrate with crypto module to decrpt password (#2170)
zhongnansu Aug 19, 2022
5c1b3fd
[MD] noAuth integration, credential & endpoint validation (#2165)
mpabba3003 Aug 19, 2022
a058cc4
[MD] Refactor search strategy to conditionally user datasource client…
zhongnansu Aug 19, 2022
a38f5d3
adding relation between credential selection and no auth checkbox (#2…
mpabba3003 Aug 19, 2022
ce6f8fc
Update getIndicesViaSearch with datasource (#2176)
kristenTian Aug 20, 2022
278d1d7
Add null header to child client spawn (#2188)
zhongnansu Aug 23, 2022
bfb8ab1
[MD][IP]Update button position & Add UT & Add skip option (#2195)
kristenTian Aug 24, 2022
63959d8
[MD]Refactor layout and validate input fields for listing and create …
noCharger Aug 25, 2022
72a1066
Enable datasource link in saveObjectManagement (#2209)
kristenTian Aug 26, 2022
868e606
Update configure data source per UX input (#2235)
kristenTian Aug 31, 2022
144649d
Enable data source audit log to file (#2215)
kristenTian Aug 31, 2022
7af0631
[MD] Refactor of credential editing page layout & refactor backend fi…
yibow98 Aug 31, 2022
b7c0b56
Tweak fetch data back to original (#2238)
kristenTian Aug 31, 2022
2e585f9
[MD] Revamped UX for data source management (#2239)
mpabba3003 Sep 1, 2022
847e4c6
[MD] Credentials security redesign (#2253)
noCharger Sep 1, 2022
ea0ee82
Add step data source UI test (#2264)
kristenTian Sep 3, 2022
6490e8c
[MD]Improve datasource server side error handling (#2236)
zhongnansu Sep 6, 2022
bf990b0
[MD] Datasource management new API change integrations (#2282)
mpabba3003 Sep 8, 2022
384eae6
Update stream test to bypass CI env generate domain attribute
kristenTian Sep 14, 2022
08f2e4c
Delete credential management
kristenTian Sep 14, 2022
8a8c3e5
Address comments
kristenTian Sep 14, 2022
442111d
[MD] Datasource Management - Create data source - Unit tests (#2341)
mpabba3003 Sep 15, 2022
efb7c27
Fix update data source & block update endpint (#2364)
kristenTian Sep 15, 2022
bd8cf04
MD datasource management-datasource table-UTs (#2350)
yibow98 Sep 15, 2022
98fa63e
reafctor based on PR 2334 comments to merge to main (#2375)
mpabba3003 Sep 15, 2022
70beb18
removing invalid urls as CI fails on link checker for inavlid urls in…
mpabba3003 Sep 15, 2022
fabc1c2
Address comments
kristenTian Sep 17, 2022
954d747
Fix DS snapshot test
kristenTian Sep 17, 2022
2939054
Add https://test.com/ to lychee exclude
kristenTian Sep 19, 2022
58e055e
Address comments
kristenTian Sep 19, 2022
3b55e4f
Remove unnessacry check
kristenTian Sep 19, 2022
3fad470
Remove not needed check
kristenTian Sep 19, 2022
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
24 changes: 12 additions & 12 deletions .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
options: --user 1001
name: Run functional tests
strategy:
strategy:
matrix:
group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ]
steps:
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
defaults:
run:
working-directory: ./artifacts
strategy:
strategy:
matrix:
include:
- name: Linux x64
Expand All @@ -145,7 +145,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: "./artifacts/.nvmrc"
node-version-file: './artifacts/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
Expand Down Expand Up @@ -173,9 +173,9 @@ jobs:
name: ${{ matrix.suffix }}-${{ env.VERSION }}
path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
retention-days: 1

bwc-tests:
needs: [ build-min-artifact-tests ]
needs: [build-min-artifact-tests]
runs-on: ubuntu-latest
container:
image: docker://opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-dashboards-integtest-v2
Expand All @@ -184,7 +184,7 @@ jobs:
defaults:
run:
working-directory: ./artifacts
strategy:
strategy:
matrix:
version: [ osd-2.0.0, osd-2.1.0, osd-2.2.0 ]
steps:
Expand All @@ -199,7 +199,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: "./artifacts/.nvmrc"
node-version-file: './artifacts/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
Expand All @@ -221,15 +221,15 @@ jobs:
if curl -I -L ${{ env.OPENSEARCH_URL }}; then
echo "::set-output name=version-exists::true"
fi

- name: Skipping tests
if: steps.verify-opensearch-exists.outputs.version-exists != 'true'
run: echo Tests were skipped because an OpenSearch release build does not exist for this version yet!

- name: Setting environment variable to run tests for ${{ matrix.version }}
if: steps.verify-opensearch-exists.outputs.version-exists == 'true'
run: echo "BWC_VERSIONS=${{ matrix.version }}" >> $GITHUB_ENV

- name: Download OpenSearch Dashboards
uses: actions/download-artifact@v3
id: download
Expand All @@ -242,7 +242,7 @@ jobs:
if: steps.verify-opensearch-exists.outputs.version-exists == 'true'
run: |
./bwctest.sh -s false -o ${{ env.OPENSEARCH_URL }} -d ${{ steps.download.outputs.download-path }}/opensearch-dashboards-${{ env.VERSION }}-linux-x64.tar.gz

- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.verify-opensearch-exists.outputs.version-exists == 'true' }}
with:
Expand Down
1 change: 1 addition & 0 deletions .lycheeexclude
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ http://noone.nowhere.none/
http://bar
http://foo
http://test.com/
https://test.com/
https://manifest.foobar
https://files.foobar/
https://tiles.foobar/
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
]
},
"dependencies": {
"@aws-crypto/client-node": "^3.1.1",
kristenTian marked this conversation as resolved.
Show resolved Hide resolved
"@elastic/datemath": "5.0.3",
"@elastic/eui": "npm:@opensearch-project/[email protected]",
"@elastic/good": "^9.0.1-kibana3",
Expand Down
19 changes: 12 additions & 7 deletions packages/osd-config-schema/src/types/stream_type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,18 @@ test('includes namespace in failure', () => {
describe('#defaultValue', () => {
test('returns default when undefined', () => {
const value = new Stream();
expect(schema.stream({ defaultValue: value }).validate(undefined)).toMatchInlineSnapshot(`
Stream {
"_events": Object {},
"_eventsCount": 0,
"_maxListeners": undefined,
}
`);
expect(schema.stream({ defaultValue: value }).validate(undefined)).toHaveProperty(
'_events',
{}
);
expect(schema.stream({ defaultValue: value }).validate(undefined)).toHaveProperty(
'_eventsCount',
0
);
expect(schema.stream({ defaultValue: value }).validate(undefined)).toHaveProperty(
'_maxListeners',
undefined
);
});

test('returns value when specified', () => {
Expand Down
12 changes: 12 additions & 0 deletions src/core/server/http/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,23 @@ export class Router implements IRouter {
if (LegacyOpenSearchErrorHelpers.isNotAuthorizedError(e)) {
return e;
}

if (isDataSourceConfigError(e)) {
return hapiResponseAdapter.handle(
opensearchDashboardsResponseFactory.badRequest({ body: e.message })
);
}
// TODO: add legacy data source client config error handling

return hapiResponseAdapter.toInternalError();
}
}
}

const isDataSourceConfigError = (error: any) => {
return error.constructor.name === 'DataSourceConfigError' && error.statusCode === 400;
};

const convertOpenSearchUnauthorized = (
e: OpenSearchNotAuthorizedError
): ErrorHttpResponseOptions => {
Expand Down
3 changes: 3 additions & 0 deletions src/dev/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,7 @@ export default {
'<rootDir>/node_modules/enzyme-to-json/serializer',
],
reporters: ['default', '<rootDir>/src/dev/jest/junit_reporter.js'],
globals: {
Uint8Array: Uint8Array,
},
};
16 changes: 14 additions & 2 deletions src/fixtures/stubbed_saved_object_index_pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import stubbedLogstashFields from './logstash_fields';

const mockLogstashFields = stubbedLogstashFields();

export function stubbedSavedObjectIndexPattern(id: string | null = null) {
return {
export function stubbedSavedObjectIndexPattern(id: string | null = null, withDataSource?: false) {
const indexPattern: any = {
id,
type: 'index-pattern',
attributes: {
Expand All @@ -45,4 +45,16 @@ export function stubbedSavedObjectIndexPattern(id: string | null = null) {
},
version: '2',
};

if (withDataSource) {
indexPattern.reference = [
{
id: 'id',
name: 'name',
type: 'data-source',
},
];
}

return indexPattern;
}
Loading