diff --git a/.github/codeql.yml b/.github/codeql.yml index 3b4adcf8bf..a2e7f81a4e 100644 --- a/.github/codeql.yml +++ b/.github/codeql.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@master with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. @@ -25,7 +25,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@master # Override language selection by uncommenting this and choosing your languages # with: # languages: go, javascript, csharp, python, cpp, java @@ -33,7 +33,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@master # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -47,4 +47,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@master diff --git a/.github/workflows/build_and_push_image.yml b/.github/workflows/build_and_push_image.yml index bf952591f9..9deae61428 100644 --- a/.github/workflows/build_and_push_image.yml +++ b/.github/workflows/build_and_push_image.yml @@ -18,7 +18,7 @@ jobs: name: Check out GitHub Repo with: ref: "${{ github.event.pull_request.head.sha }}" - uses: actions/checkout@v4 + uses: actions/checkout@main - name: Set up environment run: | @@ -42,17 +42,17 @@ jobs: run: echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@master - name: Log in to the Container registry - uses: docker/login-action@v3 + uses: docker/login-action@master with: registry: ghcr.io username: ${{ secrets.GHCR_USERNAME }} password: ${{ secrets.GHCR_TOKEN }} - name: Build narrative image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@master with: context: . file: ./Dockerfile @@ -67,7 +67,7 @@ jobs: TAG='${{ github.ref }}' - name: Build version image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@master if: ${{ github.base_ref }} == 'main' || ${{ github.base_ref }} == 'develop' with: context: . diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 0cacebadf3..c63e97545a 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -16,14 +16,14 @@ jobs: steps: - name: Log in to the Container registry - uses: docker/login-action@v3 + uses: docker/login-action@master with: registry: ghcr.io username: ${{ secrets.GHCR_USERNAME }} password: ${{ secrets.GHCR_TOKEN }} - name: Repo checkout - uses: actions/checkout@v4 + uses: actions/checkout@master - name: Set up environment run: | @@ -48,7 +48,7 @@ jobs: run: docker pull ${{ env.APP_IMAGE_TAG }} - name: Use Node JS 20 - uses: actions/setup-node@v4 + uses: actions/setup-node@master with: node-version: 20 - diff --git a/.github/workflows/tag_latest_image.yaml b/.github/workflows/tag_latest_image.yaml index ee6ea9a4b3..bf3350bca2 100644 --- a/.github/workflows/tag_latest_image.yaml +++ b/.github/workflows/tag_latest_image.yaml @@ -16,10 +16,10 @@ jobs: - name: Check out GitHub Repo with: ref: "${{ github.event.pull_request.head.sha }}" - uses: actions/checkout@v4 + uses: actions/checkout@master - name: Log in to the Container registry - uses: docker/login-action@v3 + uses: docker/login-action@master with: registry: ghcr.io username: ${{ secrets.GHCR_USERNAME }} diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 053eeba535..25d5ae1bb5 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -16,14 +16,14 @@ jobs: steps: - name: Log in to the Container registry - uses: docker/login-action@v3 + uses: docker/login-action@master with: registry: ghcr.io username: ${{ secrets.GHCR_USERNAME }} password: ${{ secrets.GHCR_TOKEN }} - name: Repo checkout - uses: actions/checkout@v4 + uses: actions/checkout@master - name: Set up environment run: | @@ -58,7 +58,7 @@ jobs: continue-on-error: true - name: Use Node JS 20 - uses: actions/setup-node@v4 + uses: actions/setup-node@main with: node-version: 20 - @@ -76,7 +76,7 @@ jobs: - name: Send to Codecov id: send_to_codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@main continue-on-error: true with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/kbase-extension/static/kbase/js/widgets/function_output/kbaseReportView.js b/kbase-extension/static/kbase/js/widgets/function_output/kbaseReportView.js index 8149e08a88..1a9531a164 100644 --- a/kbase-extension/static/kbase/js/widgets/function_output/kbaseReportView.js +++ b/kbase-extension/static/kbase/js/widgets/function_output/kbaseReportView.js @@ -34,7 +34,6 @@ define([ Events, OutputWidget ) => { - 'use strict'; return KBWidget({ name: 'kbaseReportView', version: '1.0.0', @@ -86,26 +85,15 @@ define([ }, /** - * This builds a link to the data_import_export service for downloading some file from + * This builds a link to the Blobstore service for downloading some file from * a shock node. This gets used for downloading files referenced from the report object. * If the given url is not really a shock node, this returns null. * @param {string} shockUrl - the URL to the shock node containing some file to fetch - * @param {string} name - the name of the file to download */ - importExportLink: function (shockUrl, name) { + importExportLink: function (shockUrl) { const m = shockUrl.match(/\/node\/(.+)$/); if (m) { - const query = { - id: m[1], - wszip: 0, - name: name, - }; - const queryString = Object.keys(query) - .map((key) => { - return [key, query[key]].map(encodeURIComponent).join('='); - }) - .join('&'); - return Config.url('data_import_export') + '/download?' + queryString; + return `${Config.url('blobstore')}/node/${m[1]}?download`; } return null; }, @@ -479,18 +467,16 @@ define([ const downloadIframeId = 'file-download-' + new UUID(4).format(); const linkList = ul( - fileLinks.map((link, idx) => { + fileLinks.map((link) => { const linkText = link.name || link.URL; + const dlLink = this.importExportLink(link.URL); return li( a( { id: events.addEvent({ type: 'click', - handler: () => { - const dlLink = this.importExportLink( - link.URL, - link.name || 'download-' + idx - ); + handler: (e) => { + e.preventDefault(); ui.getElement(downloadIframeId).setAttribute('src', dlLink); }, }), @@ -498,6 +484,7 @@ define([ type: 'button', ariaLabel: `download file ${linkText}`, download: 'download', + href: dlLink, }, linkText ) diff --git a/package-lock.json b/package-lock.json index 7fb28a66db..23cb8c560c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3460,7 +3460,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chalk": { "version": "2.4.2", diff --git a/test/unit/spec/function_output/kbaseReportView-spec.js b/test/unit/spec/function_output/kbaseReportView-spec.js index c93bdf8449..d59f2b6446 100644 --- a/test/unit/spec/function_output/kbaseReportView-spec.js +++ b/test/unit/spec/function_output/kbaseReportView-spec.js @@ -6,7 +6,6 @@ define([ 'narrativeConfig', 'testUtil', ], (ReportView, Jupyter, $, Mocks, Config, TestUtil) => { - 'use strict'; const FAKE_SERV_URL = 'https://ci.kbase.us/report_serv'; const REPORT_REF = '1/2/3'; @@ -330,10 +329,8 @@ define([ badUrl = 'https://ci.kbase.us/not/a/shock/url'; expect(reportWidget.importExportLink(badUrl, name)).toBeNull(); const result = reportWidget.importExportLink(goodUrl, name); - expect(result).toMatch(new RegExp('^' + Config.url('data_import_export'))); - expect(result).toContain('wszip=0'); - expect(result).toContain('name=some_file.txt'); - expect(result).toContain('id=' + shockNode); + expect(result).toMatch(new RegExp('^' + Config.url('blobstore'))); + expect(result).toContain('/node/' + shockNode + '?download'); }); it('should respond to errors by rendering an error string', async function () { @@ -416,7 +413,7 @@ define([ const fileInfo = REPORT_OBJ.file_links[0]; const fileUrlParts = fileInfo.URL.split('/'); const fileNode = fileUrlParts[fileUrlParts.length - 1]; - const expectedUrl = `${Config.url('data_import_export')}/download?id=${fileNode}&wszip=0&name=${fileInfo.name}`; + const expectedUrl = `${Config.url('blobstore')}/node/${fileNode}?download`; expect(dlIframe.getAttribute('src')).toEqual(expectedUrl); }); });