-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from yast/new-dbus-api
New D-Bus API
- Loading branch information
Showing
92 changed files
with
3,427 additions
and
1,541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ name: CI | |
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
frontend_build: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
|
@@ -33,12 +32,118 @@ jobs: | |
# run: npm run build --if-present | ||
|
||
- name: Run the tests and generate coverage report | ||
run: npm test \"src/**/*.test.js\" -- --coverage | ||
run: npm test -- --coverage | ||
|
||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
base-path: ./web | ||
path-to-lcov: ./web/coverage/lcov.info | ||
flag-name: Unit | ||
flag-name: frontend | ||
parallel: true | ||
|
||
frontend-linter: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./web | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
cache-dependency-path: 'web/package-lock.json' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run ESLint | ||
run: npm run lint | ||
|
||
backend_tests: | ||
runs-on: ubuntu-latest | ||
env: | ||
COVERAGE: 1 | ||
|
||
defaults: | ||
run: | ||
working-directory: ./service | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
distro: [ "tumbleweed" ] | ||
|
||
container: | ||
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby | ||
|
||
steps: | ||
|
||
- name: Git Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Ruby development files | ||
run: zypper --non-interactive install gcc gcc-c++ make openssl-devel ruby-devel npm augeas-devel | ||
|
||
- name: Install RubyGems dependencies | ||
run: bundle config set --local with 'development' && bundle install | ||
|
||
- name: Run the tests and generate coverage report | ||
run: bundle exec rspec test/**/*_test.rb | ||
|
||
- name: Coveralls GitHub Action | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
base-path: ./service | ||
path-to-lcov: ./service/coverage/lcov.info | ||
flag-name: backend | ||
parallel: true | ||
|
||
backend-linter: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: ./service | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
distro: [ "leap_latest" ] | ||
|
||
container: | ||
image: registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby | ||
|
||
steps: | ||
|
||
- name: Git Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Rubocop | ||
run: /usr/bin/rubocop.*-1.24.1 | ||
|
||
finish: | ||
runs-on: ubuntu-latest | ||
|
||
needs: [frontend_build, backend_tests] | ||
|
||
steps: | ||
|
||
- name: Coveralls Finished | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# D-Installer Contribution Guidelines | ||
|
||
This is an open source project and as such it welcomes all kinds of | ||
contributions. If you decide to contribute, please follow these guidelines to | ||
ensure the process is effective and pleasant both for you and the main | ||
developers. | ||
|
||
There are two main forms of contribution: providing feedback and performing code | ||
changes. | ||
|
||
## Feedback | ||
|
||
This proof of concept is currently driven by the YaST development team. The | ||
best way to reach us is at the [#yast](https://web.libera.chat/#yast) IRC | ||
channel on libera.chat or using the [YaST development mailing | ||
list](http://lists.opensuse.org/yast-devel/). | ||
|
||
## Code Changes | ||
|
||
We welcome all kinds of code contributions. However, before making any | ||
non-trivial contribution, get in touch with us first — this can prevent wasted | ||
effort on both sides. Also, have a look at the Code Structure section below. | ||
|
||
To send us your code change, use GitHub pull requests. The workflow is as | ||
follows: | ||
|
||
1. Fork the project. | ||
|
||
2. Create a topic branch based on `master`. | ||
|
||
3. Implement your change, including tests if possible. | ||
|
||
4. Publish the branch and create a pull request. | ||
|
||
5. YaST developers will review your change and possibly point out issues. | ||
Adapt the code under their guidance until they are all resolved. | ||
|
||
6. Finally, the pull request will get merged or rejected. | ||
|
||
See also [GitHub's guide on | ||
contributing](https://help.github.com/articles/fork-a-repo). | ||
|
||
If you want to do multiple unrelated changes, use separate branches and pull | ||
requests. | ||
|
||
## Code Structure | ||
|
||
This section contains a small unsorted list of the principles and guidelines we | ||
are trying to observe while developing D-Installer. | ||
|
||
The project is divided in two big parts that communicate with each other - the | ||
installer service written in Ruby (code located at the `service` directory) and | ||
the web interface written in Javascript that currently relies on the Cockpit | ||
infrastructure for some operations (code at the `web` directory). | ||
|
||
### Service Structure | ||
|
||
The service part written in Ruby is separated into two layers, a backend (in the | ||
Ruby namespace `DInstaller`) and the D-Bus interface on top (namespace | ||
`DInstaller::DBus`). | ||
|
||
Although there can be only one installation in progress, the service is | ||
structured to avoid the abuse of the Singleton programming pattern as mechanism | ||
to share the state information. The classes containing the business logic (eg. | ||
`DInstaller::Manager`, `DInstaller::Software`) are completely independent and | ||
decoupled from the ones providing the D-Bus layer. When an object of the | ||
`DInstaller::DBus` namespace is initialized, it receives the corresponding | ||
business logic object as argument. That's more robust than making those business | ||
logic objects singleton and allowing the D-Bus related ones to simply access | ||
those singletons. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ We use these resources to get more familiar with D-Bus API designing. | |
- network manager design https://people.freedesktop.org/~lkundrak/nm-docs/spec.html | ||
- anakonda D-Bus API ( spread in `*_interface.py` files https://github.com/rhinstaller/anaconda/tree/master/pyanaconda/modules | ||
|
||
## get the list of available languages | ||
## Language | ||
|
||
Iface: o.o.YaST.Installer1.Language | ||
|
||
|
@@ -78,7 +78,7 @@ identifiers: maybe LanguageTag https://www.rubydoc.info/github/yast/yast-package | |
- see https://tools.ietf.org/html/rfc4647 Matching of Language Tags | ||
- see https://lists.opensuse.org/archives/list/[email protected]/message/D52PSZ7TRID2RVM6CE6K2C2RUNNGOS6Z/ | ||
|
||
## get the list of base products | ||
## Base Product | ||
|
||
Iface: o.o.YaST.Installer1.Software | ||
|
||
|
@@ -111,7 +111,7 @@ Iface: o.o.YaST.Installer1.Software | |
- PropertiesChanged ( only standard one from org.freedesktop.DBus.Properties interface ) | ||
|
||
|
||
## interact with the storage proposal | ||
## Storage | ||
|
||
### Iface: o.o.YaST.Installer1.Storage | ||
|
||
|
@@ -200,3 +200,41 @@ Inspired by Udisks2.Partition | |
|
||
- Drive -> o.o.YaST.Installer1.Storage.Drive | ||
where partitions live | ||
|
||
## Users | ||
|
||
### iface o.o.Installer1.Users | ||
|
||
#### methods: | ||
|
||
- SetRootPassword(string value, boolean encrypted) -> void | ||
sets root password. If encrypted is set to true, it means that already encrypted password | ||
is send. | ||
example: | ||
|
||
SetRootPassword("test", false) -> () | ||
|
||
- SetRootSSHKey(string value) -> void | ||
set root ssh public keys. Use empty string to unset it. | ||
example: | ||
|
||
SetRootSSHKey("idrsa long key") -> () | ||
|
||
- SetFirstUser(string FullName, string UserName, string Password, boolean AutoLogin, map AdditionalData) -> void | ||
sets one non root user after installation. FullName and UserName has to follow restrictions | ||
for respective passwd entry. To unset it use empty UserName. | ||
example: | ||
|
||
SetRootSSHKey("idrsa long key") -> () | ||
|
||
#### Properties (all read only): | ||
|
||
- RootPasswordSet -> boolean | ||
whenever root password will be set by installer | ||
|
||
- RootSSHKey -> string | ||
root public ssh key that can be used to login to machine | ||
Can be empty which means not set | ||
|
||
- FirstUser -> struct( string FullName, string UserName, boolean AutoLogin, map AdditionalData) | ||
info about first user to set. if Username is empty, it means not set and other values can be ignored |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,7 @@ | |
source "https://rubygems.org" | ||
|
||
gemspec | ||
|
||
group :development do | ||
gem "byebug" | ||
end |
Oops, something went wrong.