Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New D-Bus API #70

Merged
merged 186 commits into from
Mar 15, 2022
Merged
Changes from 1 commit
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
1dfc842
initial new dbus service code
jreidinger Feb 16, 2022
cf99a41
Proper dependency on ruby-dbus providing dbus_attr_teader
mvidner Feb 16, 2022
9bd1f07
fix signature and name
jreidinger Feb 16, 2022
29724a4
fix return type
jreidinger Feb 16, 2022
e780b76
add separated binary for new dbus API for easier testing
jreidinger Feb 17, 2022
a6d31d7
decrease verbosity for list of available languages
jreidinger Feb 17, 2022
dda0da6
Merge remote-tracking branch 'origin/master' into new_dbus_service
jreidinger Feb 17, 2022
fab6792
fix typo
jreidinger Feb 17, 2022
6218249
Merge pull request #26 from yast/new_dbus_service
jreidinger Feb 17, 2022
b113d82
WIP
joseivanlopez Feb 18, 2022
364ec4e
WIP
joseivanlopez Feb 18, 2022
af52769
WIP: fixes on the previous split
ancorgs Feb 18, 2022
f2ae0a3
Rename (not tested!)
joseivanlopez Feb 18, 2022
f356b87
api proposal for users
jreidinger Feb 21, 2022
ff4c28f
Merge pull request #30 from yast/users_dbus_api_doc
jreidinger Feb 21, 2022
c46e8aa
fixes to make it working
jreidinger Feb 22, 2022
bffab10
Merge remote-tracking branch 'origin/new-dbus-api' into split-dbus-api
jreidinger Feb 22, 2022
b6b3577
Merge pull request #31 from yast/split-dbus-api
jreidinger Feb 22, 2022
b9885c9
add initial mock of dbus object
jreidinger Feb 22, 2022
2fe3d38
implement backend for users
jreidinger Feb 23, 2022
5f3af04
fix typo
jreidinger Feb 23, 2022
97f6153
bunch of fixes from real testing
jreidinger Feb 23, 2022
9084add
Merge branch 'master' into sync-new-dbus-api
imobachgs Feb 24, 2022
fda164c
Merge pull request #36 from yast/sync-new-dbus-api
imobachgs Feb 24, 2022
a03143b
remove left over
jreidinger Feb 24, 2022
027b4b2
Merge pull request #34 from yast/users_dbus_api
jreidinger Feb 24, 2022
73e2b45
correct all rubocop warnings
jreidinger Feb 24, 2022
04fa8f1
Split dbus and systemd services
joseivanlopez Feb 24, 2022
534ffce
Adapt scripts
joseivanlopez Feb 24, 2022
855d604
Adapt documentation
joseivanlopez Feb 24, 2022
e339da9
Add doc dir
joseivanlopez Feb 24, 2022
2fa6c56
Remove obsolete rubocop conf
joseivanlopez Feb 24, 2022
0599d7c
add rubocop to ci
jreidinger Feb 24, 2022
6074d28
Merge pull request #37 from joseivanlopez/well-known-name
joseivanlopez Feb 25, 2022
a053621
Merge branch 'new-dbus-api' into rubocop_update
jreidinger Feb 25, 2022
1e7fb8a
Merge pull request #38 from yast/rubocop_update
jreidinger Feb 25, 2022
82ae12a
initial API proposal
jreidinger Feb 25, 2022
30e2dce
add progress class
jreidinger Feb 25, 2022
664b236
first attempt for manager
jreidinger Feb 25, 2022
18b984b
api proposal for progress
jreidinger Feb 28, 2022
a7d6035
adapt to new manager API
jreidinger Feb 28, 2022
1874876
wip
jreidinger Mar 1, 2022
2128880
add workaround with sleep
jreidinger Mar 1, 2022
fec2be2
Update service/lib/dinstaller/dbus/manager.rb
jreidinger Mar 2, 2022
23b9ac1
changes from review
jreidinger Mar 2, 2022
2981954
Merge pull request #42 from yast/manager_implementation
jreidinger Mar 3, 2022
c1a6ab5
improve progress for software
jreidinger Mar 3, 2022
747a712
fix from review and more cleaning
jreidinger Mar 3, 2022
8ff2765
[web] Adapt InstallerClient to the new API
imobachgs Feb 25, 2022
0cc87d6
[service] Move language handling to a separate class
imobachgs Feb 25, 2022
50d18b1
[service] Add language packages
imobachgs Feb 25, 2022
38f9af9
[web] Fix language related tests
imobachgs Mar 4, 2022
814ec5b
Merge pull request #43 from yast/handle-language
imobachgs Mar 4, 2022
f1fd776
Merge remote-tracking branch 'origin/new-dbus-api' into software_prog…
jreidinger Mar 4, 2022
b473708
fixes and rubocop
jreidinger Mar 4, 2022
c7c8367
Merge pull request #46 from yast/software_progress
jreidinger Mar 4, 2022
c0aa336
[web] Fix Overview component tests
imobachgs Mar 4, 2022
2e234e4
Merge pull request #47 from yast/fix-overview-tests
imobachgs Mar 4, 2022
0d56d32
Drop Manager::InvalidValue in favor of Errors::InvalidValue
mvidner Mar 4, 2022
9932f54
Fix YARD param declarations
mvidner Mar 4, 2022
34347de
More YARD fixes: content
mvidner Mar 4, 2022
f98af01
More YARD: add comments and types
mvidner Mar 4, 2022
1c304b3
[service] Fix probing start-up
imobachgs Mar 4, 2022
a22ea3c
[service] Add 'byebug' to the Gemfile
imobachgs Mar 4, 2022
9825bb4
[service] Fix some issues in the software D-Bus API
imobachgs Mar 4, 2022
20df5c2
[web] Adapt the ProductSelector to the new D-Bus API
imobachgs Mar 4, 2022
122b9c8
Merge pull request #48 from yast/invalid-value-dup
mvidner Mar 7, 2022
928eb4d
Merge pull request #49 from yast/handle-software
imobachgs Mar 7, 2022
a061211
DBus object for storage proposal
joseivanlopez Mar 4, 2022
ef417b6
DBus object for storage actions
joseivanlopez Mar 4, 2022
f56ddad
Export storage objects
joseivanlopez Mar 4, 2022
9d3f0c8
Adapt manager
joseivanlopez Mar 4, 2022
6a36cf0
Remove unused method
joseivanlopez Mar 4, 2022
ddd1290
Fix typos
joseivanlopez Mar 4, 2022
4710dd6
Convert proposal settings
joseivanlopez Mar 4, 2022
31e7f53
Use public_send
joseivanlopez Mar 7, 2022
a3b28b3
Remove duplicated method
joseivanlopez Mar 7, 2022
92f903e
Remove languages
joseivanlopez Mar 7, 2022
f140582
Merge pull request #45 from joseivanlopez/storage-dbus
joseivanlopez Mar 7, 2022
0cf9a5e
Copy network configuration to the installed system
teclator Feb 25, 2022
382e664
probe network configuration
teclator Feb 25, 2022
a96b825
Apply network proposal
teclator Mar 2, 2022
9b38406
Network probe goes after software
teclator Mar 2, 2022
0741f0f
Change the chroot before network finish client
teclator Mar 3, 2022
e261216
Disable Metrics/AbcSize for Manager#install
imobachgs Mar 7, 2022
9bbc3d9
Fix number of steps
imobachgs Mar 7, 2022
ac1563c
Merge pull request #50 from yast/merge-network
imobachgs Mar 7, 2022
c62419b
Merge branch 'master' into merge-master
imobachgs Mar 7, 2022
0889597
Merge pull request #55 from yast/merge-master-again
imobachgs Mar 8, 2022
55f50d8
Reset actions
joseivanlopez Mar 8, 2022
fee0175
Merge pull request #56 from joseivanlopez/clean-storage-actions
imobachgs Mar 8, 2022
5f854a8
AvailableDevices is now a D-Bus property
imobachgs Mar 8, 2022
1d41f96
Partially adapt the Storage UI
imobachgs Mar 8, 2022
a97a866
Display storage actions
imobachgs Mar 8, 2022
864ad8d
Update the storage actions
imobachgs Mar 8, 2022
d1e902c
first draft of adapting to manager dbus api
jreidinger Mar 8, 2022
7706f62
Improve storage proposal error message
imobachgs Mar 9, 2022
05e00c5
Fix Storage component tests
imobachgs Mar 9, 2022
c8f4772
Adapt UI tests to storage changes
imobachgs Mar 9, 2022
901ea75
Remove filesize dependency
imobachgs Mar 9, 2022
e526372
Merge pull request #57 from yast/adapt-storage-ui
imobachgs Mar 9, 2022
ffa22cf
fix initial status
jreidinger Mar 9, 2022
f06359c
Merge remote-tracking branch 'origin/new-dbus-api' into adapt_manager_ui
jreidinger Mar 9, 2022
35dcc6d
fix calling install
jreidinger Mar 9, 2022
cd662c9
Use JSON for eslint configuration
imobachgs Mar 9, 2022
ab711d0
Fix a wrong reference to cockpit.variant
imobachgs Mar 9, 2022
0ae6b01
Set prettier printWidth to 100
imobachgs Mar 9, 2022
a0b8d14
Format the code using prettier
imobachgs Mar 9, 2022
6fbc2f9
Merge pull request #58 from yast/format
imobachgs Mar 9, 2022
96602f2
fix calling package callbacks
jreidinger Mar 9, 2022
e4c8361
remove no longer needed method
jreidinger Mar 9, 2022
a460863
fix sending/receiving signals
jreidinger Mar 9, 2022
83df6e3
fix also progress reporting
jreidinger Mar 9, 2022
c42daab
fix showing title
jreidinger Mar 9, 2022
963f0cf
fix tests
jreidinger Mar 9, 2022
95a440e
Merge remote-tracking branch 'origin/new-dbus-api' into adapt_manager_ui
jreidinger Mar 9, 2022
53100b1
Merge pull request #59 from yast/adapt_manager_ui
jreidinger Mar 9, 2022
1ee495e
Split InstallerClient into smaller classes
imobachgs Mar 9, 2022
6008161
Fix usage of the new client
imobachgs Mar 9, 2022
6a2d0e3
Add missing license headers
imobachgs Mar 9, 2022
0a9e836
Extract authentication functions to a separate client
imobachgs Mar 9, 2022
7d2b956
Do not inject the cockpit module in the client
imobachgs Mar 10, 2022
5d24545
Use client.software instead of software
imobachgs Mar 10, 2022
8b2db39
Fix ManagerClient name
imobachgs Mar 10, 2022
84df1fd
Fix App and Overview tests
imobachgs Mar 10, 2022
901ddd4
Format code
imobachgs Mar 10, 2022
961f981
Merge pull request #60 from yast/refactor-client
imobachgs Mar 10, 2022
b41529a
try to add also linter
jreidinger Mar 10, 2022
ca8789c
initial attempt for probing
jreidinger Mar 10, 2022
590c1d5
fix calling to get status
jreidinger Mar 10, 2022
edad8e8
fix for now when dbus is not running
jreidinger Mar 10, 2022
a209ead
Merge pull request #62 from yast/eslint_ci
jreidinger Mar 10, 2022
b59c2bd
use console.error
jreidinger Mar 10, 2022
351a7e5
Merge pull request #63 from yast/improve_status
jreidinger Mar 10, 2022
702e842
Move proxy() function to a mixin
imobachgs Mar 10, 2022
4b6e1a5
Replace onPropertyChanged with onActionsChanged
imobachgs Mar 10, 2022
3b539c0
Replace onPropertyChanged with onChange in ManagerClient
imobachgs Mar 10, 2022
c7eec2c
Unify onPropertyChanged and withProxy mixins
imobachgs Mar 10, 2022
25fee9c
Fix Overview and Storage tests
imobachgs Mar 10, 2022
3260b0a
Format and clean-up code
imobachgs Mar 10, 2022
40e24d5
Move onSignal to the withDBus mixin
imobachgs Mar 10, 2022
a08edb9
Drop the InstallerClient class
imobachgs Mar 10, 2022
db49496
Add the statuses to the client module
imobachgs Mar 10, 2022
2d8c162
Fix onChange definition in ManagerClient
imobachgs Mar 10, 2022
597dde6
Format the code using prettier
imobachgs Mar 11, 2022
a5d361d
Rename method for listening storage actions changes
dgdavid Mar 11, 2022
5dabb1f
Document a few methods
dgdavid Mar 11, 2022
156c9b4
Fix D-Bus service reference in onSignal
imobachgs Mar 14, 2022
a980630
Manager is not a singleton anymore
imobachgs Mar 8, 2022
30b67b5
Software class is not a singleton anymore
imobachgs Mar 8, 2022
d676400
DBus::Service class receives the Manager
imobachgs Mar 8, 2022
65ac7b3
Language class is not singleton anymore
imobachgs Mar 8, 2022
2bddb55
Storage backends are not singleton anymore
joseivanlopez Mar 10, 2022
253f7d9
Users is not singleton any more
joseivanlopez Mar 10, 2022
7bfab40
Add some information about code design
ancorgs Mar 10, 2022
585677b
Move callbacks logic to Status class
joseivanlopez Mar 10, 2022
194c2c2
Document Progress and minor changes
joseivanlopez Mar 11, 2022
5c0651e
Add StatusManager
joseivanlopez Mar 11, 2022
6b8424a
Documentation and minor changes
joseivanlopez Mar 11, 2022
2256caf
Minor improvements
joseivanlopez Mar 14, 2022
6408177
Fix onChange documentation in ManagerClient
imobachgs Mar 14, 2022
486e6a9
Return calcualte result
joseivanlopez Mar 14, 2022
33d2d3e
Fix call to calculate proposal
joseivanlopez Mar 14, 2022
f22e72c
Merge pull request #54 from yast/remove-singletons
joseivanlopez Mar 14, 2022
1207188
Merge pull request #65 from yast/on-changes-js-api
imobachgs Mar 14, 2022
36b3fbd
[web] Add component to inform about a DBus error
dgdavid Mar 14, 2022
4ef0e19
[web] Extract centering content to a component
dgdavid Mar 14, 2022
1dd3e38
[web] Improve substep progress bar
dgdavid Mar 14, 2022
9116b71
[web] Change footer example for probing progress
dgdavid Mar 14, 2022
dbb60b0
[web] Add screen for loading enviroment
dgdavid Mar 14, 2022
53e5bc1
[web] Suggestions from code review
dgdavid Mar 14, 2022
74cd804
[web] Fix how statuses are imported
dgdavid Mar 14, 2022
0aed548
Merge pull request #66 from yast/layout-improvements-01
dgdavid Mar 14, 2022
23ba214
Add a class to handle network settings
imobachgs Mar 8, 2022
7779fca
Do not crash when asking for available_devices
imobachgs Mar 14, 2022
aa525a5
Merge pull request #67 from yast/fix-available-devices
imobachgs Mar 14, 2022
e5ca0a2
Merge pull request #53 from yast/network-class
imobachgs Mar 15, 2022
d054a95
Add Ruby testing dependencies
imobachgs Mar 15, 2022
0a60be8
Add a test_helper
imobachgs Mar 15, 2022
407ea5b
Add a simple test for Network
imobachgs Mar 15, 2022
d8c4c8f
Fix coveralls report path
imobachgs Mar 15, 2022
ebb562e
Run service tests and submit test coverage
imobachgs Mar 15, 2022
6a4a3e6
Fix step to run frontend tests
imobachgs Mar 15, 2022
35f6ce7
Do not set Y2DIR in the test helper
imobachgs Mar 15, 2022
5bce343
Aggregate test coverage data
imobachgs Mar 15, 2022
e4c5358
Merge pull request #69 from yast/rspec
imobachgs Mar 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add initial mock of dbus object
jreidinger committed Feb 22, 2022
commit b9885c9ec014cafc89b95bac346a0ad422be042d
101 changes: 101 additions & 0 deletions service/lib/dinstaller/dbus/users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Copyright (c) [2022] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "dbus"

module DInstaller
module DBus
# YaST D-Bus object (/org/opensuse/YaST/Installer1)
#
# @see https://rubygems.org/gems/ruby-dbus
class Users < ::DBus::Object
PATH = "/org/opensuse/DInstaller/Users1".freeze
private_constant :PATH

LANGUAGE_INTERFACE = "org.opensuse.DInstaller.Users1".freeze
private_constant :USERS_INTERFACE

def initialize(logger)
@logger = logger
@root_password_set = false

super(PATH)
end

dbus_interface USERS_INTERFACE do
dbus_attr_reader :root_password_set, "b"

dbus_reader :root_ssh_key, "s", dbus_name: "RootSSHKey"

dbus_reader :first_user, "(ssba{sv})"

dbus_method :SetRootPassword, "in Value:s, in Encrypted:b" do |value, encrypted|
logger.info "Setting Root Password"
assign_root_password(value, encrypted)

self[DBus::PROPERTY_INTERFACE].PropertiesChanged(USERS_INTERFACE, {"RootPasswordSet" => !value.empty?}, [])
end

dbus_method :SetRootSSHKey, "in Value:s" do |value|
logger.info "Setting Root ssh key"
assign_root_ssh_key(value)

self[DBus::PROPERTY_INTERFACE].PropertiesChanged(USERS_INTERFACE, {"RootSSHKey" => value}, [])
end

FUSER_SIG = "in FullName:s, in UserName:s, in Password:s, in AutoLogin:b, in data:a{sv}"
dbus_method :SetFirstUser, FUSER_SIG do |full_name, user_name, password, auto_login, data|
logger.info "Setting first user #{full_name}"
assign_first_user(full_name, user_name, password, auto_login, data)

self[DBus::PROPERTY_INTERFACE].PropertiesChanged(USERS_INTERFACE, {"FirstUser" => first_user}, [])
end


end

def root_ssh_key
# TODO: write it
""
end

def first_user
# TODO: write it
["", "", false, {}]
end

def assign_root_password(value, encrypted)
# TODO: write it
end

def assign_root_ssh_key(value)
# TODO: write it
end

def assign_first_user(full_name, user_name, password, auto_login, data)
# TODO: write it
end

private

attr_reader :logger

end
end
end