-
Notifications
You must be signed in to change notification settings - Fork 455
Package Versions
Jay Michalska edited this page Sep 15, 2025
·
1 revision
The core functionality of this feature is to track and manage local package versions. This is achieved by creating LocalPackageVersion
objects.
-
PackageVersion
:- This is the base database model.
- It stores a reference to a
package_id
and aversion
string. - Represents a version of a package.
-
LocalPackageVersion
:- This is a Single Table Inheritance (STI) subclass of
PackageVersion
. - It represents a package version that is locally managed within the project.
- The
type
column in thepackage_versions
table will be set toLocalPackageVersion
for these objects.
- This is a Single Table Inheritance (STI) subclass of
The feature is activated when the OBS:AnityaDistribution
attribute is added to a Project
. This triggers a chain of events and background jobs to synchronize and manage package versions.
-
Event:
Project
attributeOBS:AnityaDistribution
is set. -
Trigger: An
after_create
action gets triggered on the new attribute. -
Action: A background job,
FetchVersionHistoriesJob
, is enqueued. -
FetchVersionHistoriesJob
Responsibilities:- Iterates through all
packages
within theProject
that now has theOBS:AnityaDistribution
attribute. - For each package, it queries the OBS backend to fetch the current version.
- For each version in the fetched history, it creates a
LocalPackageVersion
object if one does not already exist.
- Iterates through all
-
Event:
Event:VersionChange
is triggered on aPackage
within aProject
that has theOBS:AnityaDistribution
attribute. - Source: This event is typically generated by OBS when a package's version is updated (e.g., a new release is built or committed).
-
Trigger: An
after_create
action gets triggered on this event. -
Action:
after_create
action onEvent:VersionChange
will be performed. -
after_create
Action Responsibilities:- Checks if the associated
Project
has theOBS:AnityaDistribution
attribute set. - Extracts the new
version
number from the event payload. - Creates a new
LocalPackageVersion
object for the package with the new version number.
- Checks if the associated
- 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