Skip to content

Commit

Permalink
Fixes #37853 - Add OSTree remote option depth
Browse files Browse the repository at this point in the history
  • Loading branch information
lumarel committed Oct 1, 2024
1 parent ec14209 commit 4d63cfe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ <h4 translate>Sync Settings</h4>
on-save="save(repository)"
ng-if='option.input_type=="textarea"'>
</dd>
<dd bst-edit-number="genericRemoteOptions[$index].value"
on-save="save(repository)"
ng-if='option.input_type=="number"'>
</dd>
</span>
</span>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,17 @@ <h4 translate> Sync Settings </h4>
{{option.description}}
</p>
</div>
<div ng-if='option.input_type=="number"' bst-form-group label="{{ option.title | translate }}">
<input
name="option_name"
ng-model="genericRemoteOptions[$index].value"
type="number"
min="0"
placeholder="default value is {{ option.default }}"/>
<p class="help-block" translate>
{{option.description}}
</p>
</div>
</div>

<div bst-form-group label="{{ 'Download Policy' | translate }}" ng-if="repository.content_type === 'yum' || repository.content_type === 'deb' || repository.content_type === 'docker'">
Expand Down
4 changes: 3 additions & 1 deletion lib/katello/repository_types/ostree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
generic_remote_option :exclude_refs, title: N_("Exclude Refs"), type: Array, input_type: "text", delimiter: ",", default: [],
description: N_("A comma-separated list of tags to exclude during a sync. The wildcards *, ? are recognized. 'exclude_refs' is evaluated after 'include_refs'.")

generic_remote_option :depth, title: N_("Depth"), type: :number, input_type: "number", delimiter: "", default: 0, description: N_("An option to specify how many commits to traverse.")

url_description N_("URL of an OSTree repository.")

generic_content_type 'ostree_ref',
Expand Down Expand Up @@ -53,5 +55,5 @@
default_managed_content_type :ostree_ref

test_url 'https://fixtures.pulpproject.org/ostree/small/'
test_url_root_options generic_remote_options: {include_refs: ['rawhide']}.to_json
test_url_root_options generic_remote_options: {include_refs: ['rawhide'], depth: 1}.to_json
end

0 comments on commit 4d63cfe

Please sign in to comment.