-
Notifications
You must be signed in to change notification settings - Fork 441
Links
This is developer documentation about the different types of "links" that exist in the OBS
The OBS instance to OBS instance link. If a Project
has the attribute remoteurl
it acts as an read only interface to the OBS API behind this URL.
Example:
[1] pry(main)> Project.find_by(name: 'openSUSE.org').remoteurl
=> "https://api.opensuse.org/public"
The backend supports reading from such interconnects by using the sub-project syntax (project
:sub-project
). So in the example above openSUSE.org:home:hennevogel
will fetch the data from project home:hennevogel
on the remote OBS instance. Those "projects" are often called remote-projects.
-
The support in the frontend for remote-projects is spotty. Some features, workflows etc. will simply not work for them. Most prominent: You can not view them in the UI.
-
If you try to instantiate a
Project
from an interconnect you will get a string and not anProject
object... 🤯
[1] pry(main)> Project.get_by_name('home:Admin').class.name
=> "Project"
[2] pry(main)> Project.get_by_name('openSUSE.org:home:hennevogel').class.name
Found local project openSUSE.org for home:hennevogel with remoteurl https://api.opensuse.org/public
=> "String"
- You can create sub-projects of interconnect links which will supersede the remote projects. This will turn those into "real" projects so you can have a mixture of local and remote projects below an interconnect-link.
[1] pry(main)> Project.get_by_name('openSUSE.org:home').class.name
=> "String"
[2] pry(main)> Project.get_by_name('openSUSE.org:home:hennevogel').class.name
=> "Project"
[3] pry(main)> Project.get_by_name('openSUSE.org:home:dmarcoux').class.name
=> "String"
- Remote projects are also not checked for existence.
[1] pry(main)> Project.get_by_name('openSUSE.org:I:dont:exist')
Found local project openSUSE.org for I:dont:exist with remoteurl https://api.opensuse.org/public
=> "openSUSE.org:I:dont:exist"
The OBS project to OBS project links. A project-link is a Project
that has a LinkedProject
associated. This association points to the project this Project
gets its packages from.
- Instantiating a
Package
will follow project-links by default. That means that thePackage
object you get might have a differentProject
associated with it than the project name you used for instantiation... 🤯
[1] pry(main)> Package.get_by_project_and_name('openSUSE:Factory:Staging:O', 'aaa_base').project.name
=> "openSUSE:Factory:Rings:0-Bootstrap"
-
The
LinkedProject
association can point to an localProject
object or to aString
(see interconnect link) -
If the
LinkedProject
association points to a remote-project then instantiating the package will return nil... 🤯
[1] pry(main)> Package.get_by_project_and_name('home:hennevogel:hans', 'ctris')
=> nil
-
You can have more than one project link. In this case the order in which packages are searched is defined by the attribute
LinkedProject.position
. -
If you create a
Package
inside aProject
it will supersede thePackage
from the project-link.
The OBS package to OBS package link. A package link is a Package
that has a PackageKind
with the attribute kind: 'link'
associated. This association is created as soon as the package has a file called _link
in it's sources. Package links get their sources from the package they link to.
-
There is no association between the two package objects.
-
The package it links to might not be an object on our instance (see interconnect link).
-
If
Package
has local files, they supersede files from the package-link. This is often called a "branch".
The OBS Package.name
to build description file name link. A Package
can have a special file called _multibuild
in its sources which turns it into a multibuild-package.
- Instantiating a
Package
with a multibuild flavor doesn't work.
[1] pry(main)> Package.get_by_project_and_name('OBS:Server:Unstable', 'obs-server:obs-api-testsuite-rspec')&.name
=> Package::Errors::UnknownObjectError: Package not found: OBS:Server:Unstable/obs-server:obs-api-testsuite-rspec
- But you can pass an option to the instantiation method for this. So depending on how you instantiated the
Package
object in your feature/workflow/method it works for mulibuild-packages or not... 🤯
[1] pry(main)> Package.get_by_project_and_name('OBS:Server:Unstable', 'obs-server:obs-api-testsuite-rspec', {follow_multibuild: true})&.name
=> "obs-server"
- Flavors are not validated for existence 🤯
Package.get_by_project_and_name('OBS:Server:Unstable', 'obs-server:thisflavordoesnotexist', {follow_multibuild: true}).name
=> "obs-server"
- In general, combine any of the "links" above OR introduce a link cycle (link pointing to link that points back to the link) and it goes
- Also as stated above, not every feature, class or method you will find will support all of the different link types.
Read the source Luke, good luck!
- Development Environment Overview
- Development Environment Tips & Tricks
- Spec-Tips
- Code Style
- Rubocop
- Testing with VCR
- Authentication
- Authorization
- Autocomplete
- BS Requests
- Events
- ProjectLog
- Notifications
- Feature Toggles
- Build Results
- Attrib classes
- Flags
- The BackendPackage Cache
- Maintenance classes
- Cloud uploader
- Delayed Jobs
- Staging Workflow
- StatusHistory
- OBS API
- Owner Search
- Search
- Links
- Distributions
- Repository
- Data Migrations
- next_rails
- Ruby Update
- Rails Profiling
- Installing a local LDAP-server
- Remote Pairing Setup Guide
- Factory Dashboard
- osc
- Setup an OBS Development Environment on macOS
- Run OpenQA smoketest locally
- Responsive Guidelines
- Importing database dumps
- Problem Statement & Solution
- Kickoff New Stuff
- New Swagger API doc
- Documentation and Communication
- GitHub Actions
- How to Introduce Software Design Patterns
- Query Objects
- Services
- View Components
- RFC: Core Components
- RFC: Decorator Pattern
- RFC: Backend models