repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/accounts/oidc_controller.rb
app/controllers/accounts/oidc_controller.rb
module Accounts class OIDCController < ApplicationController skip_before_action :authenticate_user! before_action :load_account def authorize oidc_configuration = @account.sso_provider&.configuration unless oidc_configuration.is_a?(OIDCConfiguration) redirect_to account_sign_in_path(@...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/accounts/teams_controller.rb
app/controllers/accounts/teams_controller.rb
class Accounts::TeamsController < ApplicationController include SettingsHelper before_action :set_team, only: %i[show edit update destroy] before_action :authorize_account def index @pagy, @teams = pagy(current_account.teams) end def show @pagy, @team_memberships = pagy(@team.team_memberships) ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/accounts/sso_providers_controller.rb
app/controllers/accounts/sso_providers_controller.rb
module Accounts class SSOProvidersController < ApplicationController before_action :authorize_account def show @sso_provider = current_account.sso_provider @configuration = @sso_provider&.configuration end def new @provider_type = params[:provider_type] || "ldap" @sso_provide...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/accounts/teams/team_resources_controller.rb
app/controllers/accounts/teams/team_resources_controller.rb
class Accounts::Teams::TeamResourcesController < ApplicationController before_action :set_team def create resourceable = find_resourceable(team_resource_params[:resourceable_type], team_resource_params[:resourceable_id]) @team_resource = @team.team_resources.new(resourceable: resourceable) if @team_re...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/accounts/teams/team_memberships_controller.rb
app/controllers/accounts/teams/team_memberships_controller.rb
class Accounts::Teams::TeamMembershipsController < ApplicationController before_action :set_team def create user = User.find(team_membership_params[:user_id]) @team_membership = @team.team_memberships.new(user: user) if @team_membership.save redirect_to team_path(@team), notice: "Member was succ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/accounts/teams/team_members_search_controller.rb
app/controllers/accounts/teams/team_members_search_controller.rb
class Accounts::Teams::TeamMembersSearchController < ApplicationController before_action :set_team def index query = params[:q].to_s.strip # Get users in the account who are NOT already in this team users = if query.present? current_account.users .where.not(i...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/users/omniauth_callbacks_controller.rb
app/controllers/users/omniauth_callbacks_controller.rb
module Users class OmniauthCallbacksController < Devise::OmniauthCallbacksController before_action :set_provider before_action :set_user attr_reader :provider, :user def failure redirect_to root_path, alert: "Something went wrong" end def github handle_auth "Github" end ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/users/registrations_controller.rb
app/controllers/users/registrations_controller.rb
class Users::RegistrationsController < Devise::RegistrationsController layout 'homepage', only: [ :new, :create ] def create ActiveRecord::Base.transaction do super do |user| account = Account.create!(name: "#{user.first_name}'s Account", owner: user) if user.persisted? AccountUser.create...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/users/sessions_controller.rb
app/controllers/users/sessions_controller.rb
class Users::SessionsController < Devise::SessionsController layout 'homepage', only: [ :new, :create, :account_login, :account_create ] before_action :require_no_authentication, only: [ :account_login ] before_action :load_account_from_slug, only: [ :account_login, :account_create ] before_action :check_if_de...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/project_add_ons_controller.rb
app/controllers/projects/project_add_ons_controller.rb
class Projects::ProjectAddOnsController < Projects::BaseController before_action :set_project_add_on, only: %i[show edit update destroy] def index @project_add_ons = @project.project_add_ons end def new @project_add_on = @project.project_add_ons.build end def create @project_add_on = @project...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/project_forks_controller.rb
app/controllers/projects/project_forks_controller.rb
class Projects::ProjectForksController < Projects::BaseController before_action :set_project before_action :ensure_can_fork def index client = Git::Client.from_project(@project) @project_forks = @project.forks.includes(:child_project, :parent_project) pull_requests = client.pull_requests.select do |p...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/deployments_controller.rb
app/controllers/projects/deployments_controller.rb
class Projects::DeploymentsController < Projects::BaseController before_action :set_project before_action :set_build, only: %i[show redeploy kill] def index @pagy, @events = pagy(@project.events.includes(eventable: [ :user, :deployment ]).order(created_at: :desc)) end def show; end def redeploy n...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/metrics_controller.rb
app/controllers/projects/metrics_controller.rb
class Projects::MetricsController < Projects::BaseController include NamespaceMetricsHelper def index @time_range = params[:time_range] || "2h" start_time = parse_time_range(@time_range) end_time = Time.now @metrics = sample_metrics_across_timerange( @project.cluster.metrics.for_project(@proj...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/processes_controller.rb
app/controllers/projects/processes_controller.rb
class Projects::ProcessesController < Projects::BaseController include LogColorsHelper def index end def create kubectl = K8::Kubectl.new(active_connection) pod = K8::Stateless::Pod.new(@project) kubectl.apply_yaml(pod.to_yaml) redirect_to project_processes_path(@project), notice: "One off pod...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/environment_variables_controller.rb
app/controllers/projects/environment_variables_controller.rb
# frozen_string_literal: true class Projects::EnvironmentVariablesController < Projects::BaseController before_action :set_project def index @environment_variables = @project.environment_variables.order(:name) end def show @environment_variable = @project.environment_variables.find(params[:id]) r...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/base_controller.rb
app/controllers/projects/base_controller.rb
class Projects::BaseController < ApplicationController include ProjectsHelper before_action :set_project def active_connection @_active_connection ||= K8::Connection.new(@project, current_user) end helper_method :active_connection private def set_project @project = current_account.projects.find(...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/volumes_controller.rb
app/controllers/projects/volumes_controller.rb
class Projects::VolumesController < Projects::BaseController def new @volume = @project.volumes.new end def create @volume = @project.volumes.build(volume_params) @project.updated! if @volume.save redirect_to edit_project_path(@project), notice: "Volume saved and will be created on the next...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/services_controller.rb
app/controllers/projects/services_controller.rb
class Projects::ServicesController < Projects::BaseController before_action :set_project before_action :set_service, only: %i[update destroy] def index @services = @project.services.order(:name) end def new @service = @project.services.build end def create result = Services::Create.call(@pr...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/services/jobs_controller.rb
app/controllers/projects/services/jobs_controller.rb
class Projects::Services::JobsController < Projects::Services::BaseController before_action :set_project before_action :set_service def create timestamp = Time.current.strftime('%Y%m%d%H%M%S') job_name = "#{@service.name}-manual-#{timestamp}" kubectl = K8::Kubectl.new(active_connection) kubectl.c...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/services/domains_controller.rb
app/controllers/projects/services/domains_controller.rb
# frozen_string_literal: true class Projects::Services::DomainsController < Projects::Services::BaseController def create @domain = @service.domains.new(domain_params) if @domain.save @service.updated! render partial: "projects/services/domains/index", locals: { service: @service } else ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/services/resource_constraints_controller.rb
app/controllers/projects/services/resource_constraints_controller.rb
class Projects::Services::ResourceConstraintsController < Projects::Services::BaseController before_action :set_service def create result = ResourceConstraints::Create.call(@service.build_resource_constraint, resource_constraint_params) if result.success? @service.updated! render_partial e...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/projects/services/base_controller.rb
app/controllers/projects/services/base_controller.rb
class Projects::Services::BaseController < Projects::BaseController before_action :set_project before_action :set_service private def set_service @service = @project.services.find(params[:service_id]) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/local/onboarding_controller.rb
app/controllers/local/onboarding_controller.rb
class Local::OnboardingController < ApplicationController layout "homepage" skip_before_action :authenticate_user! def index end def account_select redirect_to new_user_session_path unless Rails.application.config.account_sign_in_only @accounts = Account.all.includes(:stack_manager) end def cr...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/controllers/local/authentication_controller.rb
app/controllers/local/authentication_controller.rb
class Local::AuthenticationController < ApplicationController skip_before_action :authenticate_user! before_action :load_account_from_slug before_action :check_if_passwordless_allowed def login if @account.stack_manager.present? redirect_to account_sign_in_path(@account.slug) elsif @account.users...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/components/form_field_component.rb
app/components/form_field_component.rb
class FormFieldComponent < ViewComponent::Base def initialize(label:, description: nil) @label = label @description = description end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/components/radio_select_card_component.rb
app/components/radio_select_card_component.rb
class RadioSelectCardComponent < ViewComponent::Base def initialize(name:, value:, checked:, href:) @name = name @value = value @checked = checked @href = href end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/sso_providers/build_sso_configuration.rb
app/actions/sso_providers/build_sso_configuration.rb
# frozen_string_literal: true module SSOProviders class BuildSSOConfiguration extend LightService::Action expects :provider_type, :configuration_params promises :configuration executed do |context| context.configuration = case context.provider_type when "ldap" LDAPConfiguration.n...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/sso_providers/update.rb
app/actions/sso_providers/update.rb
# frozen_string_literal: true module SSOProviders class Update extend LightService::Organizer def self.call(sso_provider:, sso_provider_params:, configuration_params:) sso_provider.assign_attributes(sso_provider_params) with( sso_provider: sso_provider, configuration_params: con...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/sso_providers/update_configuration.rb
app/actions/sso_providers/update_configuration.rb
# frozen_string_literal: true module SSOProviders class UpdateConfiguration extend LightService::Action expects :sso_provider, :configuration_params executed do |context| configuration = context.sso_provider.configuration unless configuration.update(context.configuration_params) con...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/sso_providers/save_configuration.rb
app/actions/sso_providers/save_configuration.rb
# frozen_string_literal: true module SSOProviders class SaveConfiguration extend LightService::Action expects :sso_provider, :configuration executed do |context| context.sso_provider.configuration = context.configuration unless context.configuration.save context.fail_and_return!("Fa...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/sso_providers/create.rb
app/actions/sso_providers/create.rb
# frozen_string_literal: true module SSOProviders class Create extend LightService::Organizer def self.call(account:, sso_provider_params:, configuration_params:, provider_type:) sso_provider = account.build_sso_provider(sso_provider_params) with( sso_provider: sso_provider, pro...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/project_forks/fork_project.rb
app/actions/project_forks/fork_project.rb
class ProjectForks::ForkProject extend LightService::Action expects :parent_project, :pull_request promises :project_fork executed do |context| parent_project = context.parent_project pull_request = context.pull_request child_project = parent_project.dup child_project.branch = pull_request.bra...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/project_forks/create.rb
app/actions/project_forks/create.rb
class ProjectForks::Create extend LightService::Organizer def self.call(parent_project:, pull_request:) with(parent_project:, pull_request:).reduce( ProjectForks::ForkProject, ProjectForks::InitializeFromCanineConfig ) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/project_forks/initialize_from_canine_config.rb
app/actions/project_forks/initialize_from_canine_config.rb
class ProjectForks::InitializeFromCanineConfig extend LightService::Action expects :project_fork executed do |context| # Skip this action if no canine_config is stored next if context.project_fork.child_project.canine_config.blank? config_data = context.project_fork.child_project.canine_config d...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/services/create_associations.rb
app/actions/services/create_associations.rb
class Services::CreateAssociations extend LightService::Action expects :service, :params executed do |context| if context.params[:service][:cron_schedule].present? CronSchedule.new( schedule: context.params[:service][:cron_schedule][:schedule], service: context.service, ) end...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/services/update.rb
app/actions/services/update.rb
class Services::Update extend LightService::Action expects :service, :params promises :service executed do |context| context.service.update(Service.permitted_params(context.params)) if context.service.cron_job? && context.params[:service][:cron_schedule].present? context.service.cron_schedule.up...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/services/save.rb
app/actions/services/save.rb
class Services::Save extend LightService::Action expects :service executed do |context| context.service.save! rescue StandardError => e context.fail_and_return!(e.message) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/services/create.rb
app/actions/services/create.rb
class Services::Create extend LightService::Organizer def self.call(service, params) with(service:, params:).reduce( Services::CreateAssociations, Services::Save, ) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/apply_template_to_values.rb
app/actions/add_ons/apply_template_to_values.rb
class AddOns::ApplyTemplateToValues extend LightService::Action expects :add_on executed do |context| add_on = context.add_on add_on.values.extend(DotSettable) variables = add_on.metadata['template'] || {} variables.keys.each do |key| variable = variables[key] if variable.is_a?(Hash...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/update.rb
app/actions/add_ons/update.rb
class AddOns::Update extend LightService::Action expects :add_on promises :add_on executed do |context| add_on = context.add_on add_on.save end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/visible_to_user.rb
app/actions/add_ons/visible_to_user.rb
# frozen_string_literal: true module AddOns class VisibleToUser extend LightService::Action expects :account_user promises :add_ons executed do |context| account_user = context.account_user user = account_user.user account = account_user.account # Admins can see all add_ons...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/filter.rb
app/actions/add_ons/filter.rb
# frozen_string_literal: true module AddOns class Filter extend LightService::Action expects :params, :add_ons promises :add_ons executed do |context| query = context.params[:q].to_s.strip if query.present? context.add_ons = context.add_ons.where("add_ons.name ILIKE ?", "%#{que...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/helm_chart_search.rb
app/actions/add_ons/helm_chart_search.rb
class AddOns::HelmChartSearch extend LightService::Action expects :query promises :response executed do |context| response = HTTParty.get("https://artifacthub.io/api/v1/packages/search?ts_query_web=#{context.query}") context.response = response.parsed_response end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/uninstall_helm_chart.rb
app/actions/add_ons/uninstall_helm_chart.rb
class AddOns::UninstallHelmChart extend LightService::Action expects :connection executed do |context| connection = context.connection add_on = connection.add_on client = K8::Helm::Client.connect(connection, Cli::RunAndLog.new(add_on)) charts = client.ls if charts.any? { |chart| chart['name']...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/helm_chart_details.rb
app/actions/add_ons/helm_chart_details.rb
class AddOns::HelmChartDetails Package = Struct.new(:chart_url, :response) do end extend LightService::Action expects :chart_url expects :version, default: nil promises :response executed do |context| url = if context.version.present? "https://artifacthub.io/api/v1/packages/helm/#{context.chart...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/save.rb
app/actions/add_ons/save.rb
class AddOns::Save extend LightService::Action expects :add_on executed do |context| unless context.add_on.save context.fail_and_return!("Failed to create add on") end end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/create.rb
app/actions/add_ons/create.rb
class AddOns::Create def self.parse_params(params) if params[:add_on][:values_yaml].present? params[:add_on][:values] = YAML.safe_load(params[:add_on][:values_yaml]) end if params[:add_on][:metadata].present? params[:add_on][:metadata] = params[:add_on][:metadata][params[:add_on][:chart_type]]...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/list.rb
app/actions/add_ons/list.rb
# frozen_string_literal: true module AddOns class List extend LightService::Organizer def self.call(account_user:, params: {}) with(account_user: account_user, params: params).reduce( AddOns::VisibleToUser, AddOns::Filter ) end end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/install_helm_chart.rb
app/actions/add_ons/install_helm_chart.rb
class AddOns::InstallHelmChart extend LightService::Action expects :connection executed do |context| add_on = context.connection.add_on add_on.update_install_stage!(0) create_namespace(context.connection) if add_on.installed? add_on.updating! else add_on.installing! end ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/helm_chart_values_schema.rb
app/actions/add_ons/helm_chart_values_schema.rb
class AddOns::HelmChartValuesSchema extend LightService::Action expects :package_id, :version promises :schema executed do |context| response = HTTParty.get( "https://artifacthub.io/api/v1/packages/#{context.package_id}/#{context.version}/values-schema" ) if response.success? context.s...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/add_ons/set_package_details.rb
app/actions/add_ons/set_package_details.rb
class AddOns::SetPackageDetails extend LightService::Action expects :add_on executed do |context| add_on = context.add_on result = AddOns::HelmChartDetails.execute(chart_url: add_on.chart_url) if result.failure? add_on.errors.add(:base, "Failed to fetch package details") context.fail_and...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/favorites/toggle.rb
app/actions/favorites/toggle.rb
# frozen_string_literal: true module Favorites class Toggle extend LightService::Action expects :user, :account, :favoriteable promises :favorite, :action_taken executed do |context| existing = Favorite.find_by( user: context.user, account: context.account, favoriteabl...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/favorites/for_user.rb
app/actions/favorites/for_user.rb
# frozen_string_literal: true module Favorites class ForUser extend LightService::Action expects :user, :account promises :favorited_projects, :favorited_clusters, :favorited_add_ons executed do |context| favorites = Favorite.where(user: context.user, account: context.account) context....
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/resource_constraints/update.rb
app/actions/resource_constraints/update.rb
class ResourceConstraints::Update extend LightService::Organizer def self.call(resource_constraint, params) with(resource_constraint:, params:).reduce( ResourceConstraints::Save ) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/resource_constraints/save.rb
app/actions/resource_constraints/save.rb
class ResourceConstraints::Save extend LightService::Action expects :resource_constraint, :params executed do |context| # Get params hash rc_params = context.params # Convert blank strings to nil rc_params.each do |key, value| rc_params[key] = nil if value.blank? end # Convert CP...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/resource_constraints/create.rb
app/actions/resource_constraints/create.rb
class ResourceConstraints::Create extend LightService::Organizer def self.call(resource_constraint, params) with(resource_constraint:, params:).reduce( ResourceConstraints::Save ) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/install_nginx_ingress.rb
app/actions/clusters/install_nginx_ingress.rb
class Clusters::InstallNginxIngress extend LightService::Action expects :cluster, :kubectl executed do |context| cluster = context.cluster kubectl = context.kubectl cluster.info("Checking if Nginx ingress controller is already installed...", color: :yellow) begin kubectl.("get deployment ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/install_telepresence.rb
app/actions/clusters/install_telepresence.rb
class Clusters::InstallTelepresence extend LightService::Action expects :cluster, :kubectl executed do |context| cluster = context.cluster kubectl = context.kubectl cluster.info("Checking if Telepresence is already installed...", color: :yellow) begin kubectl.("get deployment traffic-manag...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/visible_to_user.rb
app/actions/clusters/visible_to_user.rb
# frozen_string_literal: true module Clusters class VisibleToUser extend LightService::Action expects :account_user promises :clusters executed do |context| account_user = context.account_user user = account_user.user account = account_user.account # Admins can see all clus...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/filter.rb
app/actions/clusters/filter.rb
# frozen_string_literal: true module Clusters class Filter extend LightService::Action expects :params, :clusters promises :clusters executed do |context| query = context.params[:q].to_s.strip if query.present? context.clusters = context.clusters.where("clusters.name ILIKE ?", ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/is_ready.rb
app/actions/clusters/is_ready.rb
class Clusters::IsReady extend LightService::Action expects :connection executed do |context| client = K8::Client.new(context.connection) cluster = context.connection.cluster if client.can_connect? cluster.installing! cluster.success("Cluster is ready") else cluster.error("Clus...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/save.rb
app/actions/clusters/save.rb
class Clusters::Save extend LightService::Action expects :cluster executed do |context| context.cluster.save! end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/create.rb
app/actions/clusters/create.rb
class Clusters::Create extend LightService::Organizer def self.call(cluster, user) with(cluster:, user:).reduce( Clusters::ValidateKubeConfig, Clusters::Save, ) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/list.rb
app/actions/clusters/list.rb
# frozen_string_literal: true module Clusters class List extend LightService::Organizer def self.call(account_user:, params: {}) with(account_user: account_user, params: params).reduce( Clusters::VisibleToUser, Clusters::Filter ) end end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/install_acme_issuer.rb
app/actions/clusters/install_acme_issuer.rb
class Clusters::InstallAcmeIssuer extend LightService::Action expects :cluster, :kubectl executed do |context| cluster = context.cluster kubectl = context.kubectl cluster.info("Checking if acme issuer is already installed", color: :yellow) begin kubectl.("get clusterissuer letsencrypt -n #...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/install_build_cloud.rb
app/actions/clusters/install_build_cloud.rb
# frozen_string_literal: true module Clusters class InstallBuildCloud extend LightService::Action expects :build_cloud, :user promises :build_cloud executed do |context| build_cloud = context.build_cloud # Check if build cloud is already installed # Create BuildCloud record (names...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/install_metric_server.rb
app/actions/clusters/install_metric_server.rb
class Clusters::InstallMetricServer extend LightService::Action expects :cluster, :kubectl executed do |context| cluster = context.cluster kubectl = context.kubectl cluster.info("Checking if metric server is already installed...", color: :yellow) begin kubectl.("get deployment metrics-ser...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/install.rb
app/actions/clusters/install.rb
class Clusters::Install DEFAULT_NAMESPACE = "canine-system".freeze extend LightService::Organizer DEFAULT_RECIPE = [ Clusters::IsReady, Clusters::CreateNamespace, Clusters::InstallNginxIngress, Clusters::InstallAcmeIssuer, Clusters::InstallMetricServer, Clusters::InstallTelepresence ] ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/validate_kube_config.rb
app/actions/clusters/validate_kube_config.rb
class Clusters::ValidateKubeConfig extend LightService::Action expects :cluster, :user executed do |context| # Validate structure first connection = K8::Connection.new(context.cluster, context.user) validation_result = valid_kubeconfig_structure?(context.cluster.kubeconfig) unless validation_resu...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/clusters/create_namespace.rb
app/actions/clusters/create_namespace.rb
class Clusters::CreateNamespace extend LightService::Action expects :kubectl executed do |context| context.kubectl.apply_yaml( K8::Namespace.new( Struct.new(:namespace).new(Clusters::Install::DEFAULT_NAMESPACE) ).to_yaml ) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/providers/generate_config_json.rb
app/actions/providers/generate_config_json.rb
class Providers::GenerateConfigJson extend LightService::Action expects :provider promises :docker_config_json executed do |context| registry = context.provider.registry_base_url context.docker_config_json = create_docker_json_structure( context.provider.username, context.provider.access_to...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/providers/create_gitlab_provider.rb
app/actions/providers/create_gitlab_provider.rb
class Providers::CreateGitlabProvider EXPECTED_SCOPES = %w[ api read_repository read_registry write_registry ] extend LightService::Action expects :provider promises :provider executed do |context| base_url = context.provider.api_base_url pat_api_url = "#{base_url}/api/v4/personal_access_tokens/self...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/providers/create.rb
app/actions/providers/create.rb
# frozen_string_literal: true module Providers class Create extend LightService::Organizer def self.call(provider) if provider.github? with(provider:).reduce( Providers::CreateGithubProvider, ) elsif provider.container_registry? with(provider:).reduce( ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/providers/create_github_provider.rb
app/actions/providers/create_github_provider.rb
class Providers::CreateGithubProvider EXPECTED_SCOPES = [ "repo", "write:packages" ] extend LightService::Action expects :provider promises :provider executed do |context| client = Git::Github::Client.build_client( access_token: context.provider.access_token, api_base_url: context.provider.a...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/providers/create_docker_image_provider.rb
app/actions/providers/create_docker_image_provider.rb
class Providers::CreateDockerImageProvider extend LightService::Action expects :provider promises :provider executed do |context| provider = context.provider # Test the container registry credentials begin DockerCli.with_registry_auth( registry_url: provider.registry_base_url, ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/namespaced/set_up_namespace.rb
app/actions/namespaced/set_up_namespace.rb
class Namespaced::SetUpNamespace extend LightService::Action expects :namespaced promises :namespaced executed do |context| namespaced = context.namespaced if namespaced.namespace.blank? && namespaced.managed_namespace # autoset the namespace to the namespaced name namespaced.namespace = na...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/namespaced/validate_namespace.rb
app/actions/namespaced/validate_namespace.rb
module Namespaced class ValidateNamespace extend LightService::Action expects :namespaced, :user def self.validate_namespace_does_not_exist_or_is_managed( context, namespaced, client, existing_namespaces ) namespace_exists = existing_namespaces.any? do |ns| ns.m...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/networks/check_dns.rb
app/actions/networks/check_dns.rb
class Networks::CheckDns extend LightService::Action expects :ingress, :connection class << self def infer_expected_dns(ingress, connection) ingress.connect(connection) dns_record = ingress.hostname if dns_record[:type] == :ip_address && is_private_ip?(dns_record[:value]) cluster =...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/buildpacks/details.rb
app/actions/buildpacks/details.rb
class Buildpacks::Details extend LightService::Action expects :namespace, :name promises :result # Struct for individual buildpack versions BuildpackVersion = Struct.new( :version, :link, keyword_init: true ) do def self.from_hash(hash) new( version: hash["version"], l...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/buildpacks/search.rb
app/actions/buildpacks/search.rb
class Buildpacks::Search extend LightService::Action expects :query promises :results # Struct for individual buildpack versions BuildpackVersion = Struct.new( :version, :link, keyword_init: true ) do def self.from_hash(hash) new( version: hash["version"], link: hash["...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/global_search/search.rb
app/actions/global_search/search.rb
# frozen_string_literal: true module GlobalSearch class Search extend LightService::Action expects :account_user, :query, :limit promises :projects, :clusters, :add_ons executed do |context| query = context.query.to_s.strip limit = context.limit params = { q: query } if qu...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/environment_variables/update.rb
app/actions/environment_variables/update.rb
class EnvironmentVariables::Update extend LightService::Organizer def self.call(project:, params:, current_user:) with(project:, params:, current_user:).reduce( EnvironmentVariables::ParseTextContent, EnvironmentVariables::BulkUpdate ) end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/environment_variables/parse_text_content.rb
app/actions/environment_variables/parse_text_content.rb
class EnvironmentVariables::ParseTextContent extend LightService::Action expects :params promises :params executed do |context| unless context.params[:text_content].present? next end context.params[:environment_variables] = context.params[:text_content].strip.split("\n").map do |line| ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/environment_variables/bulk_update.rb
app/actions/environment_variables/bulk_update.rb
class EnvironmentVariables::BulkUpdate extend LightService::Action expects :project, :params expects :current_user, default: nil executed do |context| project = context.project ActiveRecord::Base.transaction do env_variable_data = context.params[:environment_variables] || [] incoming_vari...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/register_git_webhook.rb
app/actions/projects/register_git_webhook.rb
class Projects::RegisterGitWebhook extend LightService::Action expects :project executed do |context| client = Git::Client.from_project(context.project) client.register_webhook! rescue StandardError => e context.project.errors.add(:repository_url, "Failed to create webhook: #{e.message}") conte...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/update.rb
app/actions/projects/update.rb
# frozen_string_literal: true module Projects class Update extend LightService::Organizer def self.call(project, params, user) build_configuration = handle_build_configuration(project, params) handle_project_credential_provider(project, params, user) with( project:, build_...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/determine_container_image_reference.rb
app/actions/projects/determine_container_image_reference.rb
class Projects::DetermineContainerImageReference extend LightService::Action expects :project promises :container_image_reference executed do |context| project = context.project provider = project.build_provider context.container_image_reference = if project.build_configuration.present? && project...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/update_save.rb
app/actions/projects/update_save.rb
# frozen_string_literal: true module Projects class UpdateSave extend LightService::Action expects :project, :params, :build_configuration promises :project executed do |context| ActiveRecord::Base.transaction do # Update project with permitted params context.project.assign_at...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/visible_to_user.rb
app/actions/projects/visible_to_user.rb
# frozen_string_literal: true module Projects class VisibleToUser extend LightService::Action expects :account_user promises :projects executed do |context| account_user = context.account_user user = account_user.user account = account_user.account # Admins can see all proj...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/filter.rb
app/actions/projects/filter.rb
# frozen_string_literal: true module Projects class Filter extend LightService::Action expects :params, :projects promises :projects executed do |context| query = context.params[:q].to_s.strip if query.present? context.projects = context.projects.where("projects.name ILIKE ?", ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/update_build_packs.rb
app/actions/projects/update_build_packs.rb
class Projects::UpdateBuildPacks extend LightService::Action expects :build_configuration, :params executed do |context| build_configuration = context.build_configuration next context unless build_configuration&.buildpacks? build_packs_params = context.params .dig(:project, :build_configurati...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/save.rb
app/actions/projects/save.rb
class Projects::Save extend LightService::Action expects :project, :project_credential_provider expects :build_configuration, default: nil promises :project executed do |context| ActiveRecord::Base.transaction do context.project.repository_url = context.project.repository_url.strip.downcase ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/validate_git_repository.rb
app/actions/projects/validate_git_repository.rb
class Projects::ValidateGitRepository extend LightService::Action expects :project, :project_credential_provider executed do |context| # The project is not created yet, so we can't call Github::Client.from_project client = Git::Client.from_provider( provider: context.project_credential_provider.pr...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/create.rb
app/actions/projects/create.rb
# frozen_string_literal: true class Projects::Create class ToNamespaced extend LightService::Action expects :project promises :namespaced executed do |context| context.namespaced = context.project end end extend LightService::Organizer def self.create_params(params) params.requir...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/list.rb
app/actions/projects/list.rb
# frozen_string_literal: true module Projects class List extend LightService::Organizer def self.call(account_user:, params: {}) with(account_user: account_user, params: params).reduce( Projects::VisibleToUser, Projects::Filter ) end end end
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/deploy_latest_commit.rb
app/actions/projects/deploy_latest_commit.rb
class Projects::DeployLatestCommit extend LightService::Action expects :project expects :current_user, default: nil expects :skip_build, default: false promises :project, :build executed do |context| # Fetch the latest commit from the default branch project = context.project current_user = con...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/initialize_build_packs.rb
app/actions/projects/initialize_build_packs.rb
# frozen_string_literal: true module Projects class InitializeBuildPacks extend LightService::Action expects :build_configuration, :params promises :build_packs def self.fetch_buildpack_details!(build_pack) result = Buildpacks::Details.execute( namespace: build_pack.namespace, ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/projects/restart.rb
app/actions/projects/restart.rb
class Projects::Restart extend LightService::Action expects :connection executed do |context| project = context.connection.project project.services.running.each do |service| if service.web_service? || service.background_service? K8::Stateless::Deployment.new(service).connect(context.connect...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/sso/sync_user_teams.rb
app/actions/sso/sync_user_teams.rb
class SSO::SyncUserTeams extend LightService::Organizer def self.call(email:, team_names:, account:, sso_provider:, uid:, name: nil, create_teams: false) actions = [] actions << SSO::CreateTeamsInAccount if create_teams actions << SSO::CreateUserInAccount actions << SSO::SyncTeams if create_teams ...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false
CanineHQ/canine
https://github.com/CanineHQ/canine/blob/f5c94561cbc487892b393a3aa57409beeea96c62/app/actions/sso/create_user_in_account.rb
app/actions/sso/create_user_in_account.rb
# frozen_string_literal: true module SSO class CreateUserInAccount extend LightService::Action expects :email, :account, :sso_provider, :uid expects :name, default: nil promises :user executed do |context| # First try to find user by SSO provider identity provider = Provider.find_by(...
ruby
Apache-2.0
f5c94561cbc487892b393a3aa57409beeea96c62
2026-01-04T15:53:12.976830Z
false