Commit Graph

5090 Commits

Author SHA1 Message Date
Hubert Plociniczak
124147d1c0
Temporary workaround for #10921 (#10931)
Disabling caching as it seems that loading BindingsMap breaks things.
2024-08-30 18:10:25 +01:00
Radosław Waśko
50325b6a1d
Pending Audit Logs are sent in batches (#10918) 2024-08-30 15:10:54 +02:00
Hubert Plociniczak
54dc0d0bb7
Update reflect-config.json to accomodate for akka changes (#10930)
Recently (#10905) we got rid of 2 unnecessary dependencies. That seemed
to have affected the generated native-image.
2024-08-30 15:10:23 +02:00
Dmitry Bushev
6f895a5648
Add CI checks for aarch64 (#10881) 2024-08-30 09:16:01 +01:00
Hubert Plociniczak
1e6e69b539
Akka-related startup improvements (#10905)
* Akka-related startup improvements

Realized that Akka Typed and Spray were not used **at all** yet there
were in the list of dependencies.
Additionally, the former would also show up in the list of Akka's
library-extensions, initialized on startup.

* Hardcode list of library extensions

Hardcoding a list of library extensions is not recommended but I don't
see any other way of disabling expensive Serialization extension, which
we don't seem to use anyway.

* fmt

* licensing update
2024-08-29 20:43:37 +02:00
James Dunkerley
018b676607
Update what needs to be re-signed. (#10922) 2024-08-29 20:25:36 +02:00
Jaroslav Tulach
339c275338
Benchmark and speed processing of polyglot java imports up (#10899) 2024-08-29 17:20:53 +02:00
dependabot[bot]
1f9a856344
Bump webpack from 5.76.0 to 5.94.0 in /tools/enso4igv (#10916) 2024-08-29 09:33:55 +00:00
dependabot[bot]
3151857cc8
Bump micromatch from 4.0.5 to 4.0.8 in /tools/enso4igv (#10915) 2024-08-29 10:27:32 +02:00
somebody1234
848e8699d7
Dashboard UX improvements (#10868)
- Fix dropdown focus issues
- Keyboard navigation to/from dropdowns and between options
- Mouse focus to/from dropdowns (there is no mouse navigation between options)
- Use new inputs in "new secret" modal
- Simplify form types
- Switch activity log date filters to use `DatePicker` which is a wrapper around a `react-aria-components` input
- Update `react-aria-components`
- Prevent Navigator2D from handling event if it has already been `defaultPrevented`
- Switch from `*` imports to `{}` imports for various files
- Switch assets table row headings to use new components

# Important Notes
None
2024-08-29 05:54:21 +00:00
GregoryTravis
5fba57206a
Add Text.to_decimal (#10874)
Add `Text.to_decimal`.
Also makes renames `Decimal.with_scale` to `set_scale` and makes it public.
2024-08-28 19:33:20 +00:00
GregoryTravis
1804f317b2
Implement .floor, .ceil, .trunc for the in-memory Decimal column (#10887)
* wip

* wip

* test

* round pending

* changelog

* fix test

* fully enable tests

* fix test
2024-08-28 14:27:26 -04:00
GregoryTravis
8260a9587f
Column-level lexically-scoped CTE expressions (#10826)
This implements `DB_Column.with`, which uses `WITH ... AS` SQL clauses to remove duplicates in the generated SQL.

After a discussion with @radeusgd, we concluded that we will probably want a more complete CTE implementation, so this one is useful for now to deal with big queries (like `round`).

# Important Notes
Still to do in this PR:

- [x] Rename `with` to `let` (or something similar)
- [x] tests
- [x] documentation
- [x] remove `State` hack by moving query generation into a class and using a `Ref` field for scoping

Results on `round_float`:

| --- | SQL length in characters (unprettified) | SQL length in lines (prettified) |
| --- | --- | --- |
| Without CTEs | 13193 | 851 |
| With CTEs | 3644 | 187 |

Compare the SQL:

[without-ctes.sql.txt](https://github.com/user-attachments/files/16629356/without-ctes.sql.txt)
[with-ctes.sql.txt](https://github.com/user-attachments/files/16629357/with-ctes.sql.txt)

Update, with name shortening:

| --- | SQL length in characters (unprettified) | SQL length in lines (prettified) |
| --- | --- | --- |
| Without CTEs | 13193 | 853 |
| With CTEs | 2427 | 176 |

[without-cte.txt](https://github.com/user-attachments/files/16694328/without-cte.txt)
[with-cte.txt](https://github.com/user-attachments/files/16694327/with-cte.txt)
2024-08-28 18:23:51 +00:00
somebody1234
0ef074b8e9
Require accepting Terms of Service and Privacy Policy when registering (#10772)
- Frontend part of https://github.com/enso-org/cloud-v2/issues/1427
- Show ToS immediately, before login screen
- Add entries to devtools to be able to clear ToS

# Important Notes
None
2024-08-28 17:51:31 +00:00
somebody1234
50d919d952
Simplify button variants (#10828)
- Remove "cancel" variant in favor of "outline" variant
- Remove "bar" variant in favor of "outline" variant
- Buttons in the Drive Bar have been switched to a new "outline-light" variant that is the same as the "outline" variant except with the border color of the "bar" variant
- Rename "tertiary" variant to "accent"
- Remove `components/Input` and `components/ControlledInput` which are no longer used

# Important Notes
None
2024-08-28 17:05:20 +00:00
somebody1234
2c1fe33f3f
Update launch.json and flake.nix (#10854)
- Update `launch.json` to use PNPM-compatible commands
- `launch.json` is currently used for "Run and Debug" configurations in VS Code
- Update hash of rust-toolchain in `flake.nix`
- `flake.nix` is used in combination with direnv to download and add the appropriate tooling binaries to `$PATH`, on systems with direnv (and Nix) installed

# Important Notes
None
2024-08-28 16:17:48 +00:00
somebody1234
01c49ce7a2
Support multiple local directories (#10664)
- Add support for multiple local directories
- Save primary local root directory in `localStorage`
- Fix primary local root directory not updating in some conditions
- Save additional local root directories in `localStorage`
- Add buttons to browse for and reset primary local root directory

# Important Notes
None
2024-08-28 16:06:29 +00:00
Kaz Wesley
92995d191f
Fix deletion-failure bug (#10888) (#10889)
Fix intermittent deletion failures (#10888)

- Fix bug in deletion logic (the `syncModule` itself was passed to a function that tried to commit it as an edit)
- Refactor APIs to avoid similar bugs (remove `direct` edit option)

# Important Notes
- `graphStore.getMutable` provides safer access to some of the functionality that was exposed by `direct` editing.
- `graphStore.transact` has been eliminated; it was redundant with `graphStore.batchEdits`.
2024-08-28 14:28:43 +00:00
Kaz Wesley
bd5ab43cf6
Improve component comment positioning (#10885)
Implement #10691
- Comment moves out of way of menu as needed.
- Animate comment and error shifting when menu is toggled.
- Match comment/component spacing to component/error spacing.

https://github.com/user-attachments/assets/7daa342d-a7f1-4f63-b934-1519724a59a5
2024-08-28 14:10:25 +00:00
marthasharkey
069cf61b95
Initial enso changes to ScatterPlot (#10871) 2024-08-28 13:39:55 +00:00
Kaz Wesley
27f7d14140
Fix collapsed function renaming (#10884)
Fix #10763 and related issues:
- Fix bug preventing `WidgetFunctionName` from matching
- Fix missing icon when `WidgetFunctionName` matches
- Add testing for `WidgetFunctionName`
- Fix `WidgetFunctionName` padding
2024-08-28 11:05:19 +00:00
Pavel Marek
94bd396c08
Fix std benchmarks run (#10902)
* Ensure the annotation processor error message is not lost

* Dont limit ContextBuilder in BenchProcessor to enso language

* Add libraryDependencies on GraalVM.toolsPkgs to std-benchmarks

* Add some dependencies to std-benchmarks - fixes compilation

* Revert std-benchmarks project settings from #10836.

runtime-fat-jar has to be as Jar on module-path, not exploded.

* fmt
2024-08-28 12:20:38 +02:00
Radosław Waśko
80922dcd01
First/Last support in Snowflake, and partially in SQLite (#10841)
- Closes #10411
- Also a similar technique allowed to add partial support for SQLite as well.
- Only `include_nothing=True` case is still not supported as the technique used for Snowflake did not port well to SQLite and I did not find yet a satisfactory workaround (it is doable, but too ugly to justify it for now IMHO).
2024-08-28 10:00:07 +00:00
Radosław Waśko
2e5f011f3a
Move Connection classes out of Internal (#10886)
- Closes #10848
2024-08-28 08:15:07 +00:00
Radosław Waśko
ff5e4c4e0a
Include projectName in audit logs (#10892)
- Closes #9875
2024-08-27 13:13:28 +00:00
Jaroslav Tulach
1500849c32
When there are no pendingItems for a KEEP_ALIVE period, stop RequestQueue observer thread (#10890) 2024-08-27 10:10:07 +02:00
somebody1234
bd3ebc5000
Fix "Missing queryFn" error when reloading with project openn (#10894)
- Fix https://github.com/enso-org/cloud-v2/issues/1451
- Fix "Missing queryFn" error due to
- This is done by providing a default value to the query. A more ideal solution may be to use the full query with the `queryFn`, but this is not an option here as the full query for this query requires a lot more info, some of which we don't have.

# Important Notes
- Test opening a top-level project and then refreshing
- Test opening a project in a nested directory and then refreshing (to make sure the query is not being executed just because the corresponding row is visible)
2024-08-27 07:40:27 +00:00
Dmitry Bushev
4d286e02b6
Fix S3 spec (#10893)
Fixes the issue with the S3 test on CI:
```
- [FAILED] should fail to write a file if permissions are lacking [1108ms]
Reason: The value (S3 Error: User: arn:aws:iam::539646847106:user/enso_ci_s3_tester is not authorized to perform: s3:PutObject on resource: "arn:aws:s3:::enso-data-samples/examples/no-write-permissions-here.txt.bak" because no identity-based policy allows the s3:PutObject action (AccessDenied)) did not contain the element (Access Denied) (at /runner/_work/enso/enso/test/AWS_Tests/src/S3_Spec.enso:488:13-68).
```
2024-08-26 17:51:50 +00:00
Jaroslav Tulach
e9d3f59a91
Speeding up RuntimeVisualizationsTest by one minute (#10891) 2024-08-24 11:18:02 +02:00
Jaroslav Tulach
b6f0675563
IO.print without new line (#10858) 2024-08-24 07:00:16 +02:00
Hubert Plociniczak
7dc48b390e
Enable IR caches in Language Server (#10880) 2024-08-23 21:32:09 +00:00
Dmitry Bushev
09722b36dc
Provide missing arguments when stepping into a function (#10879)
close #10792

Changelog:
- update: replace missing arguments with `Nothing` when schedule a function execution in interactive mode
2024-08-23 19:13:58 +00:00
Hubert Plociniczak
3d23e22c6f
Ensure execution is scheduled after compilation (#10883)
Scheduling of jobs is asynchronous and nothing prevents it from scheduling execution before compilation leading to stale nodes in GUI. The scenario is easily reproducible by adding a `Thread.sleep` before `EnsureCompiledJob` requests compilation locks.

This change ensures that execution is only scheduled after compilation is finished, when an edit request is being processed.

# Important Notes
This fix was prompted by me getting random stale nodes after edits:
![Screenshot from 2024-08-23 16-53-26](https://github.com/user-attachments/assets/2b017539-c4bf-4d42-b597-216d887a4f4c)
(it would never recover unless another edit was made)
2024-08-23 18:18:59 +00:00
Dmitry Bushev
3bfe963e32
Lazy Diagnostic storage allocation (#10852)
close #10727



Changelog:
- add: implement lazy allocation of `DiagnosticStorage` objects
- update: compiler phases to make sure they don't allocate redundant `DiagnosticStorage` objects
- update: cleanup `DiagnosticStorage` class

# Important Notes
As a result, all 10MB of redundant `DiagnosticStorage` allocations are gone

#### Before
![2024-08-21-170148_2092x171_scrot](https://github.com/user-attachments/assets/c1fd34d5-019d-472f-b523-a5c31b87f454)

#### After
![2024-08-21-170058_1693x131_scrot](https://github.com/user-attachments/assets/10d71d81-42b7-4b3c-a49f-ca6267bc6ccf)
2024-08-23 17:48:25 +00:00
Kaz Wesley
582b7f9a2e
Fullscreen improvements (#10876)
Implements #10686.
- Add fullscreen modes to doc editor and code editor
- Contain fullscreen view within graph editor tab
- Prevent persisting or synchronizing fullscreen state
- Animate transition

https://github.com/user-attachments/assets/e88801c2-8c56-494b-8500-95fbd76c4322
2024-08-23 13:00:44 +00:00
Hubert Plociniczak
6b0194c98b
Ensure clients get write capability (#10872)
When Ydoc requests to open file and encounters a timeout, it will
attempt to retry the request. At least that's the behaviour since
 #10787.
Unfortunately, the write lock on the file might be already held and
identified by the client id and actor reference. The latter is always
determined by the request and therefore spurious. The same client should
always be given the same capability, even on retries.
2024-08-22 18:45:14 +02:00
Paweł Grabarz
7653280e33
Remove all usages of unstable rust features (#10813)
Removed all `#![feature]` flags, except for `#![feature(test)]`. Once parser benchmarks are ported to something that is compatible with stable rust, we will be able to switch to it.
2024-08-22 14:09:17 +00:00
somebody1234
60ae6f9bdb
Hotfix opening links in browser (#10869)
Fix regression causing the link to user registration to not be opened in browser.

# Important Notes
None
2024-08-22 12:41:06 +00:00
somebody1234
1c76ad50d1
Accept/decline invite to new organization (#10822)
- Frontend part of https://github.com/enso-org/cloud-v2/issues/1403
- Add a new dialog (like the Version dialog) that appears over the Drive view (unlike the ToS dialog which appears in place of the Drive view)

# Important Notes
None
2024-08-22 11:49:12 +00:00
Kaz Wesley
6261018591
Fix circular menu z-index and position (#10867)
Dropdown now covers circular menu (fixes issue from #10666).

<img width="295" alt="Screenshot 2024-08-21 at 07 59 24" src="https://github.com/user-attachments/assets/9793b185-a575-4a05-8964-da35c26fecc9">
2024-08-21 20:48:53 +00:00
Radosław Waśko
835aebdcde
Updating Cloud integration to new directory structure (#10762)
- Closes #10749
2024-08-21 18:11:27 +00:00
somebody1234
8d7b684019
User & Team spaces (#10477)
- Depends on https://github.com/enso-org/cloud-v2/pull/1344
- Implement https://github.com/enso-org/cloud-v2/issues/1342
- Refactor `Category` type to allow for extra metadata (user/team id and home directory path)
- Show list of users and teams in sidebar
- Add "My Files" category for users with team/enterprise plan - because in that case, the directory opened by the "Cloud" category is the organization's root directory, not the user's root directory

# Important Notes
None
2024-08-21 18:10:56 +00:00
Hubert Plociniczak
a65383a47b
Avoid copying IR nodes when no change is performed in passes (#10839)
* Reduce amount of IR copying

This PR ensures that we only perform IR copying when actually needed,
i.e. when one of the fields has changed.
Most of the changes should not be controversial except for equality
change in MetadataStorage. Without it, an empty pass metadata would be
treated as equal, therefore preventing duplication from happening.

* fmt

* missed a few spots

* Optimizations to copying

Avoid expensive computations for static methods.

* Avoid unnecessary unapply calls
2024-08-21 18:20:03 +02:00
Adam Obuchowicz
c294e05fd7
Do not propagate arrow events from Table Widget (#10859)
A trivial fix for bug reported in https://github.com/enso-org/enso/issues/10856

Without it, navigating selection in table widget is also displacing node.
2024-08-21 13:19:52 +00:00
Adam Obuchowicz
a9198c8d06
Make tab accept the text input (#10857)
Fixes #10855

Added handler for `tab` key. We cannot accept input on blur, as sometimes it should not be accepted (as when user clicks at drop-down option where text widget was providing filtering pattern).
2024-08-21 13:08:23 +00:00
Kaz Wesley
45a54b93cd
Dropdown improvements (#10853)
Implement changes requested in #10666.

#### Align left edge with widget

Top-level argument (edge aligned to TLA boundary):

<img width="639" alt="Screenshot 2024-08-20 at 10 10 27" src="https://github.com/user-attachments/assets/eb1712bf-1cbc-4a5d-bdb6-7458f94a27f4">

Nested (edge aligned to start of widget text):

<img width="519" alt="Screenshot 2024-08-20 at 10 11 47" src="https://github.com/user-attachments/assets/477ffe6e-ac00-41fb-bfb0-4d22c25c0f8b">

#### Adjust height

<img width="134" alt="Screenshot 2024-08-20 at 10 06 20" src="https://github.com/user-attachments/assets/17ac485e-deeb-4afd-973b-fc8c182ffb1d">

# Important Notes
- Also some HTML/CSS simplification in `CircularMenu`.
2024-08-21 12:53:11 +00:00
Adam Obuchowicz
2919e5833c
Update filtering in new CB (#10847)
Fixes #10604

Removed many parts of `filtering.ts` and `input.ts` - now our filtering is not "context aware", in the component browsing mode we just take entire input as filtering pattern.

[Screencast from 2024-08-20 11-49-20.webm](https://github.com/user-attachments/assets/23137036-5f46-4982-bac7-9196461e7c9c)

# Important Notes
As we agreed during refinement, I did not focus on exact unit testing - we need to first try the new design out.
2024-08-21 10:59:45 +00:00
Jaroslav Tulach
e5f865f1df
Print out warnings associated with local variables (#10842)
Fixes #9749 by:
- [x] Adding `fn` option to `enso-debug-server` instrument - eb3b76e
- [x] Print warnings (if any) to stderr - 4fda04b
- [x] Improving output of `:list` to print out warnings - dbe3c45480
- [x] Print errors to stderr - 1312546
- [x] Exiting on `DataflowError` - 2cc7ef5 and e6fbf73
- [x] Using all of that inside of `runner/*Main` - 7df58ef

The core of the change is in instrumentation that wraps the `main` method and at its end checks for _warnings or errors_ among local variables. When an error is found, it wraps the original return value of `main` with a proxy that delegates to the original value, but also pretends to be _exit exception_ with exit code 173. That one is detected in `Main` launcher to exit the process with exit code 173.

# Important Notes
As a side-effect of this change, one can request an invocation of REPL at the end of any method just by providing a property to the VM:
```bash
$ enso --vm.D=polyglot.enso-debug-server.method-break-point=err_test.main --run err_test.enso --repl
```
stops at the end of `main` method of `err_test.enso` file.
2024-08-21 07:00:54 +00:00
Adam Obuchowicz
22263e8ff9
Y-docs: Fix write capability recovery (#10851)
When receiving no write capability in `text/openFile` response, the method returned error without synchronizing, but session state stayed at 'Opening' - this resulted in automatic success on the next retry without actually trying.

Added additional state to handle recovery from missing write capability errors.

# Important Notes
tested by applying the patch below (which simulates problem reported by James):

```diff
diff --git a/app/ydoc-shared/src/languageServer.ts b/app/ydoc-shared/src/languageServer.ts
index e1403f50420247575b437df8c603e5f1701b5e1d..753bbf9f9f449f6130c79040e44607ce0c308f7f 100644
--- a/app/ydoc-shared/src/languageServer.ts
+++ b/app/ydoc-shared/src/languageServer.ts
@@ -3,6 +3,7 @@ import { bytesToHex } from '@noble/hashes/utils'
import { Client, RequestManager } from '@open-rpc/client-js'
import debug from 'debug'
import { ObservableV2 } from 'lib0/observable'
+import { wait } from 'lib0/promise.js'
import { uuidv4 } from 'lib0/random'
import { z } from 'zod'
import { walkFs } from './languageServer/files'
@@ -268,9 +269,25 @@ export class LanguageServer extends ObservableV2<Notifications & TransportEvents
return this.request('session/initProtocolConnection', { clientId }, false)
}

+  private openCalls = 0
/** [Documentation](https://github.com/enso-org/enso/blob/develop/docs/language-server/protocol-language-server.md#textopenfile) */
openTextFile(path: Path): Promise<LsRpcResult<response.OpenTextFile>> {
-    return this.request<response.OpenTextFile>('text/openFile', { path })
+    if (this.openCalls === 0) {
+      this.openCalls = 1
+      return wait(1000).then(() =>
+        Err(new LsRpcError('Simluated timeout', 'text/openFile', { path })),
+      )
+    } else if (this.openCalls === 1) {
+      this.openCalls = 2
+      return this.request<response.OpenTextFile>('text/openFile', { path }).then(value => {
+        if (value.ok) {
+          value.value.writeCapability = null
+        }
+        return value
+      })
+    } else {
+      return this.request<response.OpenTextFile>('text/openFile', { path })
+    }
}

/** [Documentation](https://github.com/enso-org/enso/blob/develop/docs/language-server/protocol-language-server.md#textclosefile) */
```
2024-08-20 14:42:25 +00:00
Kaz Wesley
95e50f48c9
Fix multiselect stability (#10838)
Fix #10543.
2024-08-20 12:45:35 +00:00