Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# Since Windows is inconsistent, we want to let other OSes run on a fail
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -51,11 +53,20 @@ jobs:
with:
path: OpenSearch-Dashboards/plugins/dashboards-observability

- name: Load Plugin Bootstrap cache
uses: actions/cache@v3
with:
path: |
**/node_modules
**/target
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it caching target?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It showed up when I scanned for what files bootstrap was making, I assumed it may be important. I don't know the technical details of what bootstrap does, so I might have overselected.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure why bootstrap would touch target. target is the transpiled javascript from source code (public ts/tsx) to be executed in browser, yarn start (optimizing phase) and yarn build would update target.

caching it probably won't cause an issue even if your key does not consider source code changes (because yarn build will update target anyways), but i don't think it should be cached. it's not really related to dependencies

key: ${{ runner.os }}-bootstrap-${{ hashFiles('OpenSearch-Dashboards/yarn.lock', 'OpenSearch-Dashboards/plugins/dashboards-observability/yarn.lock') }}
restore-keys: ${{ runner.os }}-bootstrap-

- name: Plugin Bootstrap
run: |
cd OpenSearch-Dashboards/plugins/dashboards-observability
yarn osd bootstrap
cd OpenSearch-Dashboards
yarn config set network-timeout 1000000 -g
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this seconds?

Copy link
Copy Markdown
Collaborator Author

@Swiddis Swiddis Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Milliseconds, this PR uses the same number as is used in the OpenSearch Dashboards CI, which in turn is inspired by a related issue on yarn that suggests a similar approach with a number that's also in that ballpark.

yarn osd bootstrap || yarn osd bootstrap
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- name: Test all dashboards-observability modules
run: |
Expand All @@ -80,4 +91,4 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: dashboards-observability-${{ matrix.os }}
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build
path: ./OpenSearch-Dashboards/plugins/dashboards-observability/build