Commit Graph

7745 Commits

Author SHA1 Message Date
Sebastian Thiel
05506f49fa
migrate AI tokens from the git-configuration to the keystore.
All AI related options are stored in the user-level git configuration
file. Upon first access, they will be removed from there and placed
into the keystore as part of the migration.

The UI is provided with functions to store and save secrets which it
will use specifically to interact with these keys.

It's explicitly out of scope to *not* show the keys in plain-text
anymore after entering them.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
de00e4f049
support global secrets (without namespace for build types) and provide commands in tauri crate
That way globals secrets can be used from the UI directly.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
b08a9e8cb1
Prevent MacOS popups each startup on MacOS
MacOS is the only known platform that exhibits this behaviour - if an app
is recompiled, the hash of the binary is used to identify it towards the keychain.
As this changes each time, the keychain will ask for permission, which is fair.

However, it's also an impediment which leads to the implementation of
a keystore that uses git credentials as backend. For this to work,
the latest version of `gitoxide` is required for now.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
7e7555567b
automatically delete empty passwords from the key store
The frontend uses this to invalidate the GitHub token, even though
it can also deal with `null`. Let's keep the keystore clean and
only keep entries that contain an actual password.

Note that the consumers, i.e. the frontend, handle an empty password
for the short time it's in memory.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
9da051b089
improve naming of tokens stored in the keychain: do not 'abuse' user field
Currently, the user is used as handle name, but instead, just name it
`GitButler`.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
fbfeba0637
auto-delete a user if its access token can't be found 2024-07-02 10:02:46 +02:00
Sebastian Thiel
ee5ff95649
Assure Sensitive fields can't be serialized
This does not only mean that they cannot be written to disk, but also
that extra work has to be done to serialize them over the wire.

This is very much by design, as they can be in structs that are
seemingly serializable and contain sensitive data, but they must
never actually be serialized.

For use in the UI, an extra type must be used that marks the secret
differently, for instance by field name.
2024-07-02 10:02:45 +02:00
Sebastian Thiel
bc8f3b74c7
tauri specializes the secret-store depending on application type
That way, there is no overlap in the technically global store, just
like before when secrets were stored in plain text.
2024-07-02 10:02:45 +02:00
Sebastian Thiel
929eb52224
auto-migrate secrets from user.json to their location in the keyring
This will also remove them from their plain-text location.

Further, when the secrets are required they will be obtained
specifically, instead of always having them at hand.

The frontend doesn't ever show these, but needs them, and
it now asks for them when it needs them.
2024-07-02 10:02:43 +02:00
Sebastian Thiel
f3e6c7ba94
Add the capability to store and retrieve secrets
This is a global facility without any state, and provides a simplified
interface to the `keyring` crate.
2024-07-02 10:01:44 +02:00
Sebastian Thiel
cedb893ad6
put 'core::serde' into its own module file
It started small, but now is large enough to warrant that.
2024-07-02 10:01:44 +02:00
Kiril Videlov
18006a9f2a
Merge pull request #4212 from gitbutlerapp/dependabot/cargo/tauri-plugin-log-862c42a 2024-07-01 19:05:22 +02:00
Kiril Videlov
abae97fea0
Merge pull request #4213 from gitbutlerapp/dependabot/cargo/tauri-plugin-single-instance-862c42a 2024-07-01 19:05:06 +02:00
Kiril Videlov
dbba13f16b
Merge pull request #4214 from gitbutlerapp/dependabot/cargo/tauri-plugin-store-862c42a 2024-07-01 19:04:55 +02:00
Kiril Videlov
8a46a6c496
Merge pull request #4215 from gitbutlerapp/dependabot/cargo/tauri-plugin-window-state-862c42a 2024-07-01 19:04:47 +02:00
dependabot[bot]
34673ef938
Bump tauri-plugin-window-state from 5e3900e to 862c42a
Bumps [tauri-plugin-window-state](https://github.com/tauri-apps/plugins-workspace) from `5e3900e` to `862c42a`.
- [Release notes](https://github.com/tauri-apps/plugins-workspace/releases)
- [Commits](5e3900e682...862c42a457)

---
updated-dependencies:
- dependency-name: tauri-plugin-window-state
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 15:42:06 +00:00
dependabot[bot]
b60e5a2714
Bump tauri-plugin-store from 5e3900e to 862c42a
Bumps [tauri-plugin-store](https://github.com/tauri-apps/plugins-workspace) from `5e3900e` to `862c42a`.
- [Release notes](https://github.com/tauri-apps/plugins-workspace/releases)
- [Commits](5e3900e682...862c42a457)

---
updated-dependencies:
- dependency-name: tauri-plugin-store
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 15:41:06 +00:00
dependabot[bot]
523bfa5160
Bump tauri-plugin-single-instance from 5e3900e to 862c42a
Bumps [tauri-plugin-single-instance](https://github.com/tauri-apps/plugins-workspace) from `5e3900e` to `862c42a`.
- [Release notes](https://github.com/tauri-apps/plugins-workspace/releases)
- [Commits](5e3900e682...862c42a457)

---
updated-dependencies:
- dependency-name: tauri-plugin-single-instance
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 15:40:13 +00:00
dependabot[bot]
f001fc819b
Bump tauri-plugin-log from 5e3900e to 862c42a
Bumps [tauri-plugin-log](https://github.com/tauri-apps/plugins-workspace) from `5e3900e` to `862c42a`.
- [Release notes](https://github.com/tauri-apps/plugins-workspace/releases)
- [Commits](5e3900e682...862c42a457)

---
updated-dependencies:
- dependency-name: tauri-plugin-log
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 15:37:54 +00:00
Caleb Owens
82c3987d45
Unapply to real branches (#4025)
* Don't return optional

* Rename get_integration_commiter

* Add a header to wip commit

* Stuff

* Unapply all branches

* Reorder code

* Fix one test

* Name resolution

* Fix two tests

* Fix another!

* wip

* Fix so many tests

* Fix unapply.rs tests

* Fix selected for changes tests

* Move unapplying logic to delete_branch method

* Remove unused and kinda borked cherry_commit code

* Fix the tests!!!!!

* Make apply_branch private

* Change handling of headers

* Improve order integrity

* Updated types and comments to convey more meaning
2024-07-01 14:13:52 +00:00
Nico Domino
9aac60b1e4
fix: add Sentry RewriteFrames integration (#4210) 2024-07-01 13:38:15 +02:00
Mattias Granlund
d4c0b97f7d Use pr source branch as title in branch list 2024-06-30 19:56:44 +03:00
Mattias Granlund
8851780851 Fix bug related to switching from integration branch
- value of projects store should never be undefined
2024-06-30 19:53:19 +03:00
Pavel Laptev
d9f314f49b
Do not allow pxToRem function get undifined (#4206)
* Do not allow `pxToRem` function get `undifined`

* `TextBox` width fix
2024-06-29 15:26:44 +02:00
Mattias Granlund
7f929837f9 Show remote branch using name instead of sha
- multiple branches can have the same sha
2024-06-28 17:58:42 +03:00
Mattias Granlund
7073308c9a Drop unused symbols
- been meaing to remove these for a while
2024-06-28 15:41:03 +03:00
Mattias Granlund
9912e2df40 chore: update incorrect variable names in BranchFooter 2024-06-28 14:38:10 +03:00
Mattias Granlund
0082099f8c Fix bug in PushButton component
- show selected action rather than preferred action
2024-06-28 14:23:21 +03:00
Mattias Granlund
fd3e846989 Fail gracefully if remote branch not found 2024-06-28 12:57:43 +03:00
Kiril Videlov
720e50d5a5
Merge pull request #4200 from gitbutlerapp/refactor-move-error-marker
move error marker out of virtual_branches mod
2024-06-28 11:48:42 +02:00
Mattias Granlund
8f052c04b7 Fix commit dialog backspace bug
- place curstor at end of commit title when backspacing from empty description
2024-06-28 12:39:07 +03:00
Kiril Videlov
b72f9c2199
move error marker out of virtual_branches mod
It's useful outside of it
2024-06-28 11:35:44 +02:00
Mattias Granlund
f67744eea1 Fix for incorrect GitHub error when working in non-GitHub repos 2024-06-28 12:32:33 +03:00
Kiril Videlov
b623952fdd
Merge pull request #4198 from gitbutlerapp/remove-print-tree-function
refactor: Remove unused _print_tree function.
2024-06-28 11:21:26 +02:00
Kiril Videlov
1137111430
Merge pull request #4197 from gitbutlerapp/refactor-rebasing-functions
refactor: move rebase functions out of virtual_branches module
2024-06-28 11:17:10 +02:00
Kiril Videlov
8ed324580c
refactor: Remove unused _print_tree function. 2024-06-28 11:10:27 +02:00
Kiril Videlov
251d56677d
refactor: move rebase functions out of virtual_branches module
This opens the doors for further simplifying the core
2024-06-28 11:04:15 +02:00
Kiril Videlov
f16afa6e4e
Merge pull request #4194 from gitbutlerapp/login-robustness
more robust login handling by deleting corrupt user.json file
2024-06-27 23:17:56 +02:00
Caleb Owens
dd0b4eccf1
Improve ai error handling (#4180)
* Introduce a result type

* Update AI error handling to use the result type

* Handle ollama json parse error

* Migrate using Error as the type that represents errors

* Remove now useless condition

* asdfasdf

* Use andThen

* Correct unit tests
2024-06-27 20:50:44 +01:00
Pavel Laptev
518cc8b77e
Fix overflow issue for the Generate msg dropdown (#4195) 2024-06-27 16:48:57 +02:00
Sebastian Thiel
adc50a7e7f
more robust login handling by deleting corrupt user.json file
If a user.json file cannot be loaded, delete it automatically
to avoid users to get stuck in 'something went wrong' during layout.

Older versions of GB wouldn't find the access-token in the user.json file
anymore, which would be completely removed via #4165
2024-06-27 15:10:48 +02:00
Pavel Laptev
900316ad7a
Fix: Base icon CSS (#4193)
- Fix top margin for unfolded base row
- Fix CSS variables (added new, remove ununsed)
2024-06-27 00:40:33 +02:00
Kiril Videlov
41b1b93bf0
Merge pull request #4190 from gitbutlerapp/remove-unused-rsqlite-dep
refactor: Remove rusqlite dependency and related code.
2024-06-26 16:33:52 +02:00
Kiril Videlov
b886ff84f1
refactor: Remove rusqlite dependency and related code. 2024-06-26 16:21:24 +02:00
Pavel Laptev
b4509efa44
Allow rebasing toogle menu position updated (#4189) 2024-06-26 15:48:01 +02:00
Kiril Videlov
6da1b444ba
Merge pull request #4188 from gitbutlerapp/Add-an-allow-rebasing-toggle-on-per-branch-basis
Add an 'allow rebasing' toggle on per-branch basis
2024-06-26 14:20:55 +02:00
Kiril Videlov
324941ea0e
add tooltip on the allow rebasing toggle for lanes 2024-06-26 14:02:36 +02:00
Kiril Videlov
3fb7f3b8bb
add the ability to toggle the allow rebasing flag for lanes in the UI 2024-06-26 13:53:13 +02:00
Kiril Videlov
d17534d291
adds the ability to update the allow_rebasing flag on branches and fix tests 2024-06-26 10:23:31 +02:00
Pavel Laptev
8de4c3b651
Don't focus the last item if multiple selection (#4186) 2024-06-25 22:48:33 +02:00