-
Notifications
You must be signed in to change notification settings - Fork 461
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. The support in the frontend for this is spotty.
If you try to instantiate a Project from an interconnect you will get a string and not an Project 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 the Package object you get might have a different Project associated with it then the Project 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"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.
The association can point to an local Project object or to a String (see interconnect link)
If you create a Package inside a Project it will supersede the Package 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 even be an object on our instance (see interconnect link). There is Package.linkinfo however, this method will tell you the project and name this Package gets its sources from.
If Package has local files, they supersede files from the package-link. This is often called a "branch".
In general, combine any of the above OR introduce a 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
- Test in kanku
- 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
- Package Versions
- next_rails
- Ruby Update
- Rails Profiling
- 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
- Brakeman
- How to Introduce Software Design Patterns
- Query Objects
- Services
- View Components
- RFC: Core Components
- RFC: Decorator Pattern
- RFC: Backend models
- RFC: Hotwire Turbo Frames Pattern
