Skip to content

Commit

Permalink
Merge branch 'master' into sccproxy-activations-error-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbv authored Nov 6, 2024
2 parents ed98758 + 275b917 commit 9a33df8
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 19 deletions.
14 changes: 6 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
awesome_print (1.9.2)
base32 (0.3.4)
Expand Down Expand Up @@ -136,13 +136,13 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
hashdiff (1.1.0)
hashdiff (1.1.1)
hpricot (0.8.6)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.3.1)
jsonapi-renderer (0.2.2)
jwt (2.9.0)
jwt (2.9.3)
base64
listen (3.6.0)
rb-fsevent (~> 0.10, >= 0.10.3)
Expand Down Expand Up @@ -209,8 +209,7 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.6)
strscan
rexml (3.3.9)
ronn (0.7.3)
hpricot (>= 0.8.2)
mustache (>= 0.7.0)
Expand Down Expand Up @@ -296,7 +295,6 @@ GEM
sqlite3 (1.4.4)
strong_migrations (0.7.9)
activerecord (>= 5)
strscan (3.1.0)
sync (0.5.0)
term-ansicolor (1.7.1)
tins (~> 1.0)
Expand All @@ -317,7 +315,7 @@ GEM
activesupport (>= 3)
railties (>= 3)
yard (~> 0.9.20)
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
2 changes: 1 addition & 1 deletion PACKAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Note: Look below for direction on publishing to registry.
```
* Alternatively, if an OBS working copy is already checked out, update the working copy by running `osc up`
2. Run `make dist` in your RMT working directory to build a tarball.
3. Copy the files from the `package/obs` directory to the OBS working directory.
3. Copy the files from the `package/obs` directory to the OBS working directory `systemsmanagement:SCC:RMT/rmt-server`.
4. Examine the changes by running `osc status` and `osc diff`.
5. Stage the changes by running `osc addremove`.
6. Build the package with osc:
Expand Down
13 changes: 13 additions & 0 deletions db/migrate/20240821114908_change_local_path_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class ChangeLocalPathType < ActiveRecord::Migration[6.1]
def up
safety_assured do
change_column :repositories, :local_path, :string, limit: 512
change_column :downloaded_files, :local_path, :string, limit: 512
end
end

def down
change_column :repositories, :local_path, :string
change_column :downloaded_files, :local_path, :string
end
end
6 changes: 3 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_07_29_103525) do
ActiveRecord::Schema.define(version: 2024_08_21_114908) do

create_table "activations", charset: "utf8", force: :cascade do |t|
t.bigint "service_id", null: false
Expand All @@ -34,7 +34,7 @@
create_table "downloaded_files", charset: "utf8", force: :cascade do |t|
t.string "checksum_type"
t.string "checksum"
t.string "local_path"
t.string "local_path", limit: 512
t.bigint "file_size", unsigned: true
t.index ["checksum_type", "checksum"], name: "index_downloaded_files_on_checksum_type_and_checksum"
t.index ["local_path"], name: "index_downloaded_files_on_local_path", unique: true
Expand Down Expand Up @@ -104,7 +104,7 @@
t.string "auth_token"
t.boolean "installer_updates", default: false, null: false
t.boolean "mirroring_enabled", default: false, null: false
t.string "local_path", null: false
t.string "local_path", limit: 512, null: false
t.datetime "last_mirrored_at"
t.string "friendly_id"
t.index ["external_url"], name: "index_repositories_on_external_url", unique: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@

context 'when verification provider returns false' do
before do
expect(InstanceVerification::Providers::Example).to receive(:new)
.with(be_a(ActiveSupport::Logger), be_a(ActionDispatch::Request), payload, instance_data).and_return(plugin_double)
expect(plugin_double).to receive(:instance_valid?).and_return(false)
stub_request(:post, scc_activate_url)
.to_return(
status: 200,
body: { error: 'Unexpected instance verification error has occurred' }.to_json,
headers: {}
)
post url, params: payload, headers: headers
end

Expand All @@ -86,9 +89,13 @@

context 'when verification provider raises an unhandled exception' do
before do
expect(InstanceVerification::Providers::Example).to receive(:new)
.with(be_a(ActiveSupport::Logger), be_a(ActionDispatch::Request), payload, instance_data).and_return(plugin_double)
expect(plugin_double).to receive(:instance_valid?).and_raise('Custom plugin error')
stub_request(:post, scc_activate_url)
.to_return(
status: 422,
body: { error: 'Unexpected instance verification error has occurred' }.to_json,
headers: {}
)

post url, params: payload, headers: headers
end

Expand Down Expand Up @@ -623,7 +630,7 @@
.with({ headers: scc_headers, body: payload.merge({ byos_mode: 'byos' }) })
.and_return(
status: 401,
body: { error: 'error_message' }.to_json,
body: 'Migration target not allowed on this instance type',
headers: {}
)
request
Expand Down
1 change: 1 addition & 0 deletions package/obs/rmt-server.changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Wed Aug 21 15:28:43 UTC 2024 - Jesús Bermúdez Velázquez <jesus.bv@suse.com>

- Version 2.19
* Fix for mirroring products that contain special characters (eg.: '$') in their path
* Fix for packages with path longer 255 characters (bsc#1229152)
* rmt-server-pubcloud:
* Support registration of extensions in BYOS mode on top of a PAYG system (hybrid mode) (jsc#PCT-400)
* Validate repository and registy access for hybrid systems
Expand Down

0 comments on commit 9a33df8

Please sign in to comment.