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

Merge issues branch #557

Merged
merged 66 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
1daf2a9
[web] Rename the layout slot for app actions
dgdavid Apr 21, 2023
c005251
[web] Add new layout slot for contextual/page actions
dgdavid Apr 21, 2023
27715e8
[web] Add a new ContextualActions core component
dgdavid Apr 21, 2023
67ce72c
[web] Remove header no longer needed
dgdavid Apr 21, 2023
1d2f5ef
[web] Adapt ProposalPage for using ContextualActions
dgdavid Apr 21, 2023
834ffc8
[web] Move ProposalPage options to its own file
dgdavid Apr 21, 2023
1e46837
[web] Adapt NetworkPage for using ContextualActions
dgdavid Apr 21, 2023
e403deb
[web] Fix broken test
dgdavid Apr 21, 2023
1e79a2d
[web] Display the change product link always
dgdavid Apr 21, 2023
dd0065b
[web] Drop the PageOptions layout slot
dgdavid Apr 21, 2023
3145b0a
[web] Drop PageOptions component
dgdavid Apr 21, 2023
dcdf6ba
[web] CSS adjustment
dgdavid Apr 21, 2023
1cb6b59
[web] Internal improvements for NetworkPage
dgdavid Apr 21, 2023
e5e9ec0
[web] Do not import no longer used test util
dgdavid Apr 21, 2023
e91e7cc
[web] Limit when connect to WiFi menu option is rendered
dgdavid Apr 24, 2023
d80381b
[web] Delete a no longer needed nor true hint
dgdavid Apr 24, 2023
a492944
[web] Drop Sidebar.OpenButton component
dgdavid Apr 24, 2023
390329e
[web] Add documentation and test for ContextualActions
dgdavid Apr 24, 2023
a195e8d
[web] CSS adjustment
dgdavid Apr 24, 2023
6a89990
[web] Rename ContextualActions to PageOptions
dgdavid Apr 24, 2023
fd4f079
[web] Add documentation
dgdavid Apr 24, 2023
a60b512
[web] Update the changes file
dgdavid Apr 24, 2023
6d9c61b
[web] Please linters
dgdavid Apr 25, 2023
a0d7685
[web] Add a the initial version of a notification mark
dgdavid Apr 25, 2023
1bad2a0
Merge pull request #545 from openSUSE/contextual-actions-2nd-approach
dgdavid Apr 25, 2023
921d28c
Merge pull request #546 from openSUSE/notification-mark
joseivanlopez Apr 25, 2023
78b4ab4
[service] Add Issue class
joseivanlopez Apr 26, 2023
04e87fd
[service] Add issues interface
joseivanlopez Apr 26, 2023
f957f2e
[service] Add shared examples for progress
joseivanlopez Apr 26, 2023
d57181c
[service] Add issues to storage
joseivanlopez Apr 26, 2023
d832985
[service] Adapt storage client
joseivanlopez Apr 26, 2023
3a29e94
[service] Changelog
joseivanlopez Apr 26, 2023
d86b948
[service] Improve doc
joseivanlopez Apr 27, 2023
b1b9366
Merge pull request #548 from joseivanlopez/storage-issues-dbus
joseivanlopez Apr 27, 2023
62de9cf
Update README screenshots
dgdavid Apr 27, 2023
e1f621e
[web] Add issues to storage client
joseivanlopez Apr 28, 2023
365e999
[web] Add issues client
joseivanlopez Apr 28, 2023
1fc1f6f
[web] Replace validation by storage issues
joseivanlopez Apr 28, 2023
5df7f38
[web] Add issues warning
joseivanlopez Apr 28, 2023
8aa109e
[web] Add notification mark to sidebar
joseivanlopez Apr 28, 2023
7bcba1c
[web] Add issues page
joseivanlopez Apr 28, 2023
8ca7aba
[web] Changelog
joseivanlopez Apr 28, 2023
090ebf9
Update take_screenshots.spec.ts
lslezak Apr 29, 2023
40bd362
[web] Do not show group options name until needed
dgdavid May 2, 2023
48dfa5b
[web] Add missing unit test
dgdavid May 2, 2023
a1cf46e
Merge pull request #555 from openSUSE/improve-storage-options
dgdavid May 2, 2023
95e2daa
[web] Hide notification mark after visiting issues
joseivanlopez May 2, 2023
3bf9ee4
[web] Improve aria-label
joseivanlopez May 2, 2023
9878116
[web] Wrap issue details
joseivanlopez May 2, 2023
4ce28f1
[web] Remove leftover
joseivanlopez May 2, 2023
05ea541
[web] Do not use description from storage issues
joseivanlopez May 3, 2023
9b48e0d
CI: mount /dev in the container
lslezak May 3, 2023
541bc83
Merge pull request #540 from joseivanlopez/storage-issues
joseivanlopez May 4, 2023
85f5af5
Merge branch 'master' into issues
joseivanlopez May 4, 2023
3263a9e
Fix integration tests in CI
lslezak May 4, 2023
238c114
CI debugging - display environment
lslezak May 4, 2023
f313131
Fixed GitHub actions check
lslezak May 4, 2023
4520612
Delete old screenshot
lslezak May 4, 2023
9fe3ef5
Add a new screenshot
lslezak May 4, 2023
cce4243
Update test
lslezak May 5, 2023
780d11f
Update storage screenshot
lslezak May 5, 2023
ab6eaf4
Merge pull request #553 from openSUSE/fix-take-screenshots-test
dgdavid May 5, 2023
750a753
Updated screenshots
lslezak May 5, 2023
32aaa54
[web] Load proposal if needed
joseivanlopez May 5, 2023
0e8d1de
[web] Only subscribe when needed
joseivanlopez May 5, 2023
0ad0066
Merge pull request #559 from joseivanlopez/fix-proposal-page
joseivanlopez May 5, 2023
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
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ jobs:
- name: Git Checkout
uses: actions/checkout@v3

- name: Created shared yast log distro
- name: Created shared YaST log directory
run: mkdir -p /tmp/log/YaST2

- name: start container
run: podman run --privileged --detach --name agama --ipc=host -v .:/checkout -v /tmp/log/YaST2:/var/log/YaST2 registry.opensuse.org/yast/head/containers/containers_tumbleweed/opensuse/agama-testing:latest
- name: Start container
run: podman run --privileged --detach --name agama --ipc=host -e CI -e GITHUB_ACTIONS -v /dev:/dev -v .:/checkout -v /tmp/log/YaST2:/var/log/YaST2 registry.opensuse.org/yast/head/containers/containers_tumbleweed/opensuse/agama-testing:latest

- name: Environment
run: podman exec agama bash -c "env | sort"

- name: Install Ruby gems
run: podman exec agama bash -c "cd /checkout/service && bundle config set --local path 'vendor/bundle' && bundle install"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Agama is a new Linux installer born in the core of the YaST team. It is designed

|||
|-|-|
| ![Storage page](./doc/images/screenshots/storage-page.png) | ![Storage settings](./doc/images/screenshots/storage-settings.png) |
| ![Users page](./doc/images/screenshots/users-page.png) | ![Storage settings](./doc/images/screenshots/storage-page.png) |

|||
|-|-|
Expand Down
Binary file modified doc/images/screenshots/storage-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/images/screenshots/storage-settings.png
Binary file not shown.
Binary file added doc/images/screenshots/users-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 7 additions & 8 deletions playwright/tests/take_screenshots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ test.describe("The Installer", () => {
// the the root password must be set
await test.step("Set the root password", async () => {
await page.locator("a[href='#/users']").click();
// Create users page screenshot
await page.screenshot({ path: "screenshots/users-page.png" });
await page.locator("#actions-for-root-password").click();
await page.getByRole("menuitem", { name: "Set" }).click();
await page.locator("#password").fill("linux");
Expand All @@ -78,15 +80,12 @@ test.describe("The Installer", () => {
await test.step("Storage configuration", async () => {
// create storage page screenshot
await page.locator("a[href='#/storage']").click();
await expect(page.getByRole("button", { name: "Settings" })).toBeVisible();
await expect(page.getByRole("heading", { name: "Settings" })).toBeVisible();
// skip this in GitHub CI, there is no suitable disk for installation
if (process.env.GITHUB_ACTIONS !== "true") {
await expect(page.getByText("Installation device")).toBeVisible({timeout: minute / 2});
}
await page.screenshot({ path: "screenshots/storage-page.png" });

// create storage settings screenshot
await page.getByRole("button", { name: "Settings" }).click();
await expect(page.locator("[role='dialog']")).toBeVisible();
await page.screenshot({ path: "screenshots/storage-settings.png" });
await page.getByRole("button", { name: "Cancel" }).click();
await page.getByText("Back").click();
});

// confirm the installation only when explicitly set via the environment
Expand Down
24 changes: 23 additions & 1 deletion service/lib/agama/dbus.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
# frozen_string_literal: true

# Copyright (c) [2022-2023] 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.

module Agama
# Namespace for DBus API
# Namespace for D-Bus API
module DBus
end
end

require "agama/dbus/manager"
require "agama/dbus/language"
require "agama/dbus/software"
require "agama/dbus/storage"
require "agama/dbus/users"
require "agama/dbus/questions"
4 changes: 2 additions & 2 deletions service/lib/agama/dbus/clients/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
require "agama/dbus/clients/base"
require "agama/dbus/clients/with_service_status"
require "agama/dbus/clients/with_progress"
require "agama/dbus/clients/with_validation"
require "agama/dbus/clients/with_issues"

module Agama
module DBus
Expand All @@ -31,7 +31,7 @@ module Clients
class Storage < Base
include WithServiceStatus
include WithProgress
include WithValidation
include WithIssues

STORAGE_IFACE = "org.opensuse.Agama.Storage1"
private_constant :STORAGE_IFACE
Expand Down
54 changes: 54 additions & 0 deletions service/lib/agama/dbus/clients/with_issues.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# frozen_string_literal: true

# Copyright (c) [2023] 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 "agama/issue"

module Agama
module DBus
# Mixin to include in the clients of services that implement the Issues interface
module WithIssues
ISSUES_IFACE = "org.opensuse.Agama1.Issues"
private_constant :ISSUES_IFACE

# Returns the issues
#
# @return [Array<Issue>]
def issues
sources = [nil, Issue::Source::SYSTEM, Issue::Source::CONFIG]
severities = [Issue::Severity::WARN, Issue::Severity::ERROR]

dbus_object[ISSUES_IFACE]["All"].map do |dbus_issue|
Issue.new(dbus_issue[0],
details: dbus_issue[1],
source: sources[dbus_issue[2]],
severity: severities[dbus_issue[3]])
end
end

# Determines whether there are errors
#
# @return [Boolean]
def errors?
issues.any?(&:error?)
end
end
end
end
33 changes: 33 additions & 0 deletions service/lib/agama/dbus/interfaces.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

# Copyright (c) [2023] 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.

module Agama
module DBus
# Namespace for generic D-Bus interfaces
module Interfaces
end
end
end

require "agama/dbus/interfaces/issues"
require "agama/dbus/interfaces/progress"
require "agama/dbus/interfaces/service_status"
require "agama/dbus/interfaces/validation"
74 changes: 74 additions & 0 deletions service/lib/agama/dbus/interfaces/issues.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# frozen_string_literal: true

# Copyright (c) [2023] 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"
require "agama/issue"

module Agama
module DBus
module Interfaces
# Mixin to define the Issues D-Bus interface
#
# @note This mixin is expected to be included in a class that inherits from {DBus::BaseObject}
# and it requires a #issues method that returns an array of {Issue} objects.
module Issues
ISSUES_INTERFACE = "org.opensuse.Agama1.Issues"

# Issues with the D-Bus format
#
# @return [Array<Array(String, String, Integer, Integer)>] The description, details, source
# and severity of each issue.
# Source: 1 for system, 2 for config and 3 for unknown.
# Severity: 0 for warn and 1 for error.
def dbus_issues
issues.map do |issue|
source = case issue.source
when Agama::Issue::Source::SYSTEM
1
when Agama::Issue::Source::CONFIG
2
else
0
end
severity = issue.severity == Agama::Issue::Severity::WARN ? 0 : 1

[issue.description, issue.details.to_s, source, severity]
end
end

# Emits the signal for properties changed
def issues_properties_changed
dbus_properties_changed(ISSUES_INTERFACE,
interfaces_and_properties[ISSUES_INTERFACE], [])
end

def self.included(base)
base.class_eval do
dbus_interface ISSUES_INTERFACE do
# @see {#dbus_issues}
dbus_reader :dbus_issues, "a(ssuu)", dbus_name: "All"
end
end
end
end
end
end
end
35 changes: 21 additions & 14 deletions service/lib/agama/dbus/storage/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
require "yast"
require "agama/dbus/base_object"
require "agama/dbus/with_service_status"
require "agama/dbus/interfaces/issues"
require "agama/dbus/interfaces/progress"
require "agama/dbus/interfaces/service_status"
require "agama/dbus/interfaces/validation"
require "agama/dbus/storage/dasd_manager_interface"
require "agama/dbus/storage/proposal"
require "agama/dbus/storage/proposal_settings_converter"
Expand All @@ -43,9 +43,9 @@ class Manager < BaseObject
include WithISCSIAuth
include WithServiceStatus
include ::DBus::ObjectManager
include DBus::Interfaces::Issues
include DBus::Interfaces::Progress
include DBus::Interfaces::ServiceStatus
include DBus::Interfaces::Validation

PATH = "/org/opensuse/Agama/Storage1"
private_constant :PATH
Expand All @@ -57,6 +57,7 @@ class Manager < BaseObject
def initialize(backend, logger)
super(PATH, logger: logger)
@backend = backend
register_storage_callbacks
register_proposal_callbacks
register_progress_callbacks
register_service_status_callbacks
Expand All @@ -68,14 +69,18 @@ def initialize(backend, logger)
register_and_extend_dasd_callbacks
end

# List of issues, see {DBus::Interfaces::Issues}
#
# @return [Array<Agama::Issue>]
def issues
backend.issues
end

STORAGE_INTERFACE = "org.opensuse.Agama.Storage1"
private_constant :STORAGE_INTERFACE

def probe
busy_while do
backend.probe
storage_properties_changed
end
busy_while { backend.probe }
end

def install
Expand All @@ -90,7 +95,7 @@ def finish
#
# @return [Boolean]
def deprecated_system
backend.deprecated_system
backend.deprecated_system?
end

dbus_interface STORAGE_INTERFACE do
Expand Down Expand Up @@ -241,11 +246,15 @@ def proposal
backend.proposal
end

def register_storage_callbacks
backend.on_issues_change { issues_properties_changed }
backend.on_deprecated_system_change { storage_properties_changed }
end

def register_proposal_callbacks
proposal.on_calculate do
export_proposal
proposal_properties_changed
update_validation
end
end

Expand Down Expand Up @@ -278,12 +287,6 @@ def register_and_extend_dasd_callbacks
end
end

def deprecate_system
backend.deprecated_system = true
storage_properties_changed
update_validation
end

def storage_properties_changed
properties = interfaces_and_properties[STORAGE_INTERFACE]
dbus_properties_changed(STORAGE_INTERFACE, properties, [])
Expand All @@ -294,6 +297,10 @@ def proposal_properties_changed
dbus_properties_changed(PROPOSAL_CALCULATOR_INTERFACE, properties, [])
end

def deprecate_system
backend.deprecated_system = true
end

def export_proposal
@service.unexport(dbus_proposal) if dbus_proposal
@dbus_proposal = DBus::Storage::Proposal.new(proposal, logger)
Expand Down
Loading