Skip to content

Commit

Permalink
Merge branch 'develop' into wip/sergeigarin/open-project-timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount committed Dec 22, 2024
2 parents e5c6c74 + 3932679 commit 2b35f74
Show file tree
Hide file tree
Showing 121 changed files with 2,039 additions and 809 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/engine-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-engine-pull-request
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

permissions:
checks: write
Expand All @@ -36,7 +36,7 @@ jobs:
secrets: inherit

required-checks:
name: Required Checks
name: Engine Required Checks
runs-on: ubuntu-latest
needs: [engine-checks]
if: always()
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/gui-changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ jobs:
.prettierrc.js
.prettierignore
vitest.workspace.ts
.github/workflows/gui-changed-files.yml
.github/workflows/gui-checks.yml
.github/workflows/gui-pull-request.yml
.github/workflows/gui*
.github/workflows/ide*
.github/workflows/storybook.yml
files_ignore: |
app/ide-desktop/**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gui-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on: workflow_call
# Cancel in-progress workflows if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-gui-checks
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

permissions:
contents: read # Read-only access to repository contents
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gui-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-gui-pull-request
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

permissions:
contents: read # Read-only access to repository contents
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
secrets: inherit

required-checks:
name: Required Checks
name: GUI Required Checks
runs-on: ubuntu-latest
needs: [prettier, gui-checks, storybook]
if: always()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is auto-generated. Do not edit it manually!
# Edit the enso_build::ci_gen module instead and run `cargo run --package enso-build-ci-gen`.

name: GUI Packaging (Optional)
name: IDE Packaging (Optional)
on:
workflow_dispatch:
inputs:
Expand All @@ -12,7 +12,7 @@ on:
default: false
workflow_call: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-gui-packaging-optional
group: ${{ github.workflow }}-${{ github.ref }}-ide-packaging-optional
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
jobs:
enso-build-ci-gen-job-build-backend-macos-amd64:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is auto-generated. Do not edit it manually!
# Edit the enso_build::ci_gen module instead and run `cargo run --package enso-build-ci-gen`.

name: GUI Packaging
name: IDE Packaging
on:
workflow_dispatch:
inputs:
Expand All @@ -12,7 +12,7 @@ on:
default: false
workflow_call: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-gui-packaging
group: ${{ github.workflow }}-${{ github.ref }}-ide-packaging
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
jobs:
enso-build-ci-gen-job-build-backend-linux-amd64:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is not auto-generated. Feel free to edit it.

name: GUI Packaging
name: IDE

on:
push:
Expand All @@ -9,8 +9,8 @@ on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-gui-packaging-pull-request
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}-ide-pull-request
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
gui-changed-files:
Expand All @@ -23,31 +23,31 @@ jobs:
uses: ./.github/workflows/engine-changed-files.yml
secrets: inherit

gui-packaging:
ide-packaging:
name: 📦 Package
uses: ./.github/workflows/gui-packaging.yml
uses: ./.github/workflows/ide-packaging.yml
needs: [gui-changed-files, engine-changed-files]
if: needs.gui-changed-files.outputs.any_changed == 'true' || needs.engine-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop'
secrets: inherit

gui-packaging-optional:
ide-packaging-optional:
name: 📦 Package (Optional)
uses: ./.github/workflows/gui-packaging-optional.yml
uses: ./.github/workflows/ide-packaging-optional.yml
needs: [gui-changed-files, engine-changed-files]
if: needs.gui-changed-files.outputs.any_changed == 'true' || needs.engine-changed-files.outputs.any_changed == 'true' || github.ref == 'refs/heads/develop'
secrets: inherit

required-checks:
name: Required Checks
name: IDE Required Checks
runs-on: ubuntu-latest
needs: [gui-packaging]
needs: [ide-packaging]
if: always()
steps:
- name: Checks Summary
run: |
echo "GUI Packaging: ${{ needs.gui-packaging.result }}"
echo "IDE: ${{ needs.ide-packaging.result }}"
if [[ "${{ needs.gui-packaging.result }}" == "failure" ]]; then
if [[ "${{ needs.ide-packaging.result }}" == "failure" ]]; then
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: workflow_call
# Cancel in-progress workflows if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-chromatic
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

permissions:
contents: read # Read-only access to repository contents
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wasm-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-wasm-pull-request
cancel-in-progress: true
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}

jobs:
wasm-changed-files:
Expand All @@ -26,7 +26,7 @@ jobs:
secrets: inherit

required-checks:
name: Required Checks
name: WASM Required Checks
runs-on: ubuntu-latest
needs: [wasm-checks]
if: always()
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@

#### Enso Language & Runtime

- [Promote broken values instead of ignoring them][11777].
- [Intersection types & type checks][11600]
- A constructor or type definition with a single inline argument definition was
previously allowed to use spaces in the argument definition without
parentheses. [This is now a syntax error.][11856]
- Symetric, transitive and reflexive [equality for intersection types][11897]

[11777]: https://github.com/enso-org/enso/pull/11777
[11600]: https://github.com/enso-org/enso/pull/11600
[11856]: https://github.com/enso-org/enso/pull/11856
[11897]: https://github.com/enso-org/enso/pull/11897

# Next Release

Expand Down Expand Up @@ -132,6 +136,7 @@
- [Enhance Managed_Resource to allow implementation of in-memory caches][11577]
- [Added `add_group_number` to the in-memory database.[11818]
- [The reload button clears the HTTP cache.][11673]
- [SQL Server Support for Aggregate][11811]

[11235]: https://github.com/enso-org/enso/pull/11235
[11255]: https://github.com/enso-org/enso/pull/11255
Expand All @@ -142,6 +147,7 @@
[11577]: https://github.com/enso-org/enso/pull/11577
[11818]: https://github.com/enso-org/enso/pull/11818
[11673]: https://github.com/enso-org/enso/pull/11673
[11811]: https://github.com/enso-org/enso/pull/11811

#### Enso Language & Runtime

Expand Down
1 change: 1 addition & 0 deletions app/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"./src/backendQuery": "./src/backendQuery.ts",
"./src/queryClient": "./src/queryClient.ts",
"./src/utilities/data/array": "./src/utilities/data/array.ts",
"./src/utilities/errors": "./src/utilities/errors.ts",
"./src/utilities/data/dateTime": "./src/utilities/data/dateTime.ts",
"./src/utilities/data/newtype": "./src/utilities/data/newtype.ts",
"./src/utilities/data/object": "./src/utilities/data/object.ts",
Expand Down
5 changes: 4 additions & 1 deletion app/common/src/queryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function createQueryClient<TStorageValue = string>(
storage: persisterStorage,
// Prefer online first and don't rely on the local cache if user is online
// fallback to the local cache only if the user is offline
maxAge: queryCore.onlineManager.isOnline() ? -1 : DEFAULT_QUERY_PERSIST_TIME_MS,
maxAge: DEFAULT_QUERY_PERSIST_TIME_MS,
buster: DEFAULT_BUSTER,
filters: { predicate: query => query.meta?.persist !== false },
prefix: 'enso:query-persist:',
Expand Down Expand Up @@ -130,6 +130,9 @@ export function createQueryClient<TStorageValue = string>(
defaultOptions: {
queries: {
...(persister != null ? { persister } : {}),
// Default set to 'always' to don't pause ongoing queries
// and make them fail.
networkMode: 'always',
refetchOnReconnect: 'always',
staleTime: DEFAULT_QUERY_STALE_TIME_MS,
retry: (failureCount, error: unknown) => {
Expand Down
14 changes: 11 additions & 3 deletions app/common/src/text/english.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"submit": "Submit",
"retry": "Retry",

"arbitraryFetchError": "An error occurred while fetching data",
"arbitraryFetchImageError": "An error occurred while fetching an image",

"createFolderError": "Could not create new folder",
"createProjectError": "Could not create new project",
"createDatalinkError": "Could not create new Datalink",
Expand All @@ -17,6 +21,9 @@
"deleteAssetError": "Could not delete '$0'",
"restoreAssetError": "Could not restore '$0'",

"refetchQueriesPending": "Getting latest updates...",
"refetchQueriesError": "Could not get latest updates. Some information may be outdated",

"localBackendDatalinkError": "Cannot create Datalinks on the local drive",
"localBackendSecretError": "Cannot create secrets on the local drive",
"offlineUploadFilesError": "Cannot upload files when offline",
Expand Down Expand Up @@ -174,6 +181,7 @@
"getCustomerPortalUrlBackendError": "Could not get customer portal URL",
"duplicateLabelError": "This label already exists.",
"emptyStringError": "This value must not be empty.",
"resolveProjectAssetPathBackendError": "Could not get asset",

"directoryAssetType": "folder",
"directoryDoesNotExistError": "Unable to find directory. Does it exist?",
Expand Down Expand Up @@ -477,9 +485,9 @@
"hidePassword": "Hide password",
"showPassword": "Show password",
"copiedToClipboard": "Copied to clipboard",
"noResultsFound": "No results found.",
"youAreOffline": "You are offline.",
"cannotCreateAssetsHere": "You do not have the permissions to create assets here.",
"noResultsFound": "No results found",
"youAreOffline": "You are offline",
"cannotCreateAssetsHere": "You do not have the permissions to create assets here",
"enableVersionChecker": "Enable Version Checker",
"enableVersionCheckerDescription": "Show a dialog if the current version of the desktop app does not match the latest version.",
"disableAnimations": "Disable animations",
Expand Down
52 changes: 52 additions & 0 deletions app/common/src/utilities/errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* An error that occurs when a network request fails.
*
* This error is used to indicate that a network request failed due to a network error,
* such as a timeout or a connection error.
*/
export class NetworkError extends Error {
/**
* Create a new {@link NetworkError} with the specified message.
* @param message - The message to display when the error is thrown.
*/
constructor(message: string, options?: ErrorOptions) {
super(message, options)
this.name = 'NetworkError'
}
}

/**
* An error that occurs when the user is offline.
*
* This error is used to indicate that the user is offline, such as when they are
* not connected to the internet or when they are on an airplane.
*/
export class OfflineError extends Error {
/**
* Create a new {@link OfflineError} with the specified message.
* @param message - The message to display when the error is thrown.
*/
constructor(message: string = 'User is offline', options?: ErrorOptions) {
super(message, options)
this.name = 'OfflineError'
}
}

/**
* An error with a display message.
*
* This message can be shown to a user.
*/
export class ErrorWithDisplayMessage extends Error {
readonly displayMessage: string
/**
* Create a new {@link ErrorWithDisplayMessage} with the specified message and display message.
* @param message - The message to display when the error is thrown.
* @param options - The options to pass to the error.
*/
constructor(message: string, options: ErrorOptions & { displayMessage: string }) {
super(message, options)
this.name = 'ErrorWithDisplayMessage'
this.displayMessage = options.displayMessage
}
}
29 changes: 18 additions & 11 deletions app/gui/integration-test/dashboard/actions/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import * as actions from '.'
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import invariant from 'tiny-invariant'

const __dirname = dirname(fileURLToPath(import.meta.url))

Expand Down Expand Up @@ -1129,17 +1130,23 @@ async function mockApiInternal({ page, setupAPI }: MockParams) {
})
})

await get(remoteBackendPaths.getProjectAssetPath(GLOB_PROJECT_ID, '*'), (route, request) => {
const maybeId = request.url().match(/[/]projects[/]([^?/]+)/)?.[1]
if (!maybeId) return
const projectId = backend.ProjectId(maybeId)
called('getProjectAsset', { projectId })
return route.fulfill({
// This is a mock SVG image. Just a square with a black background.
body: '/mock/svg.svg',
contentType: 'text/plain',
})
})
await get(
remoteBackendPaths.getProjectAssetPath(GLOB_PROJECT_ID, '*'),
async (route, request) => {
const maybeId = request.url().match(/[/]projects[/]([^?/]+)/)?.[1]

invariant(maybeId, 'Unable to parse the ID provided')

const projectId = backend.ProjectId(maybeId)

called('getProjectAsset', { projectId })

return route.fulfill({
// This is a mock SVG image. Just a square with a black background.
path: join(__dirname, '../mock/example.png'),
})
},
)

await page.route('mock/svg.svg', (route) => {
return route.fulfill({ body: MOCK_SVG, contentType: 'image/svg+xml' })
Expand Down
Loading

0 comments on commit 2b35f74

Please sign in to comment.