katello 3.11.0 → 3.11.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/organizations_controller.rb +2 -1
  3. data/app/controllers/katello/api/v2/products_controller.rb +6 -4
  4. data/app/lib/actions/katello/host/erratum/install.rb +1 -1
  5. data/app/lib/actions/katello/host/package/install.rb +1 -1
  6. data/app/lib/actions/katello/host/package/remove.rb +1 -1
  7. data/app/lib/actions/katello/host/package/update.rb +10 -2
  8. data/app/lib/actions/katello/host/package_group/install.rb +1 -1
  9. data/app/lib/actions/katello/host/package_group/remove.rb +1 -1
  10. data/app/lib/actions/pulp/abstract_async_task.rb +1 -1
  11. data/app/lib/actions/pulp/consumer/abstract_content_action.rb +2 -0
  12. data/app/lib/katello/concerns/renderer_extensions.rb +1 -1
  13. data/app/lib/katello/util/path_with_substitutions.rb +1 -18
  14. data/app/models/katello/concerns/redhat_extensions.rb +3 -7
  15. data/app/models/katello/erratum.rb +1 -1
  16. data/app/models/katello/ostree_branch.rb +1 -3
  17. data/app/models/katello/ping.rb +17 -10
  18. data/app/models/katello/root_repository.rb +9 -1
  19. data/app/models/katello/sync_plan.rb +1 -31
  20. data/app/services/katello/pulp/repository/yum.rb +2 -2
  21. data/app/views/katello/api/v2/ostree_branches/show.json.rabl +1 -1
  22. data/app/views/katello/api/v2/repositories/base.json.rabl +1 -1
  23. data/app/views/katello/api/v2/subscriptions/manifest_history.json.rabl +1 -1
  24. data/app/views/katello/api/v2/sync_plans/show.json.rabl +1 -5
  25. data/db/migrate/20190326145039_remove_version_date_from_ostree_branch.rb +5 -0
  26. data/db/seeds.d/111-upgrade_tasks.rb +3 -1
  27. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/content-view-version-content.controller.js +1 -1
  28. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/versions/views/content-view-version-ostree-branches.html +0 -2
  29. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment-ostree.html +0 -2
  30. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/errata/details/views/erratum-content-hosts.html +1 -1
  31. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/ostree-branches/details/views/ostree-branch-info.html +0 -3
  32. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/repository-details-info.controller.js +2 -2
  33. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-manage-ostree-branches.html +0 -4
  34. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/sync-plan-details-info.controller.js +9 -2
  35. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/sync-plans/details/views/sync-plan-info.html +1 -1
  36. data/lib/katello/tasks/upgrades/3.8/clear_checksum_type.rake +12 -0
  37. data/lib/katello/version.rb +1 -1
  38. data/webpack/components/SelectOrg/SelectOrgAction.js +1 -1
  39. data/webpack/components/SelectOrg/SetOrganization.js +4 -4
  40. data/webpack/components/WithOrganization/__snapshots__/withOrganization.test.js.snap +159 -25
  41. data/webpack/components/WithOrganization/withOrganization.js +17 -2
  42. data/webpack/components/WithOrganization/withOrganization.test.js +6 -2
  43. data/webpack/redux/actions/RedHatRepositories/__tests__/helpers.test.js +13 -0
  44. data/webpack/redux/actions/RedHatRepositories/helpers.js +9 -0
  45. data/webpack/redux/actions/RedHatRepositories/repositorySetRepositories.js +2 -0
  46. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/RepositorySetRepository.js +4 -2
  47. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository/__test__/RepositorySetRepository.test.js +1 -1
  48. data/webpack/scenes/RedHatRepositories/components/SearchBar.js +1 -1
  49. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +1 -0
  50. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +12 -3
  51. data/webpack/scenes/Subscriptions/SubscriptionsSelectors.js +3 -0
  52. data/webpack/scenes/Subscriptions/__tests__/__snapshots__/SubscriptionsReducer.test.js.snap +28 -0
  53. data/webpack/scenes/Subscriptions/index.js +2 -2
  54. metadata +10 -3
  55. data/app/views/katello/sync_management/_sync_plans.html.erb +0 -23
@@ -2,7 +2,7 @@ object @resource
2
2
 
3
3
  attributes :id, :organization_id
4
4
  attributes :name, :description
5
- attributes :interval, :next_sync
5
+ attributes :interval, :next_sync, :sync_date
6
6
  attributes :created_at, :updated_at
7
7
  attributes :enabled, :foreman_tasks_recurring_logic_id
8
8
  attributes :cron_expression
@@ -27,7 +27,3 @@ node :permissions do |sync_plan|
27
27
  :destroy_sync_plans => sync_plan.deletable?
28
28
  }
29
29
  end
30
-
31
- node :sync_date do |sync_plan|
32
- sync_plan.plan_date_time
33
- end
@@ -0,0 +1,5 @@
1
+ class RemoveVersionDateFromOstreeBranch < ActiveRecord::Migration[5.2]
2
+ def change
3
+ remove_column :katello_ostree_branches, :version_date, :timestamp
4
+ end
5
+ end
@@ -7,6 +7,8 @@ UpgradeTask.define_tasks(:katello) do
7
7
  {:name => 'katello:upgrades:3.9:migrate_sync_plans'},
8
8
  {:name => 'katello:upgrades:3.10:clear_invalid_repo_credentials'},
9
9
  {:name => 'katello:upgrades:3.11:import_yum_metadata'},
10
- {:name => 'katello:upgrades:3.11:update_puppet_repos'}
10
+ {:name => 'katello:upgrades:3.11:update_puppet_repos'},
11
+ {:name => 'katello:upgrades:3.11:clear_checksum_type', :task_name => 'katello:upgrades:3.8:clear_checksum_type'}
12
+
11
13
  ]
12
14
  end
@@ -62,7 +62,7 @@
62
62
  params: {
63
63
  'content_type': "ostree",
64
64
  'content_view_version_id': $scope.$stateParams.versionId,
65
- 'sort_by': 'created',
65
+ 'sort_by': 'version',
66
66
  'sort_order': 'DESC'
67
67
  }
68
68
  },
@@ -9,7 +9,6 @@
9
9
  <th bst-table-column translate>Name</th>
10
10
  <th bst-table-column translate>Version</th>
11
11
  <th bst-table-column translate>Commit</th>
12
- <th bst-table-column translate>Date</th>
13
12
  </tr>
14
13
  </thead>
15
14
 
@@ -18,7 +17,6 @@
18
17
  <td bst-table-cell>{{ branch.name }}</td>
19
18
  <td bst-table-cell>{{ branch.version }}</td>
20
19
  <td bst-table-cell>{{ branch.commit }}</td>
21
- <td bst-table-cell>{{ branch.version_date }}</td>
22
20
  </tr>
23
21
  </tbody>
24
22
  </table>
@@ -18,7 +18,6 @@
18
18
  <th bst-table-column translate>Name</th>
19
19
  <th bst-table-column translate>Version</th>
20
20
  <th bst-table-column translate>Commit</th>
21
- <th bst-table-column translate>Date</th>
22
21
  </tr>
23
22
  </thead>
24
23
 
@@ -27,7 +26,6 @@
27
26
  <td bst-table-cell>{{ branch.name }}</td>
28
27
  <td bst-table-cell>{{ branch.version }}</td>
29
28
  <td bst-table-cell>{{ branch.commit }}</td>
30
- <td bst-table-cell>{{ branch.version_date }}</td>
31
29
  </tr>
32
30
  </tbody>
33
31
  </table>
@@ -26,7 +26,7 @@
26
26
  </a>
27
27
  </div>
28
28
 
29
- <div class="filters">
29
+ <div data-block="filters">
30
30
  <label class="checkbox-inline">
31
31
  <input type="checkbox" ng-model="restrictInstallable" ng-change="toggleInstallable()"/>
32
32
  <span translate>Only show content hosts where the errata is currently installable in the host's Lifecycle Environment.</span>
@@ -10,9 +10,6 @@
10
10
 
11
11
  <dt translate>Commit</dt>
12
12
  <dd>{{ branch.commit }}</dd>
13
-
14
- <dt translate>Date</dt>
15
- <dd>{{ branch.version_date }}</dd>
16
13
  </dl>
17
14
  </div>
18
15
  </div>
@@ -41,7 +41,7 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
41
41
  return false;
42
42
  });
43
43
 
44
- results.unshift({id: null});
44
+ results.unshift({id: null, name: ''});
45
45
  deferred.resolve(results);
46
46
  });
47
47
 
@@ -61,7 +61,7 @@ angular.module('Bastion.repositories').controller('RepositoryDetailsInfoControll
61
61
  return false;
62
62
  });
63
63
 
64
- results.unshift({id: null});
64
+ results.unshift({id: null, name: ''});
65
65
  deferred.resolve(results);
66
66
  });
67
67
 
@@ -19,7 +19,6 @@
19
19
  <th bst-table-column><span translate>Branch Name</span></th>
20
20
  <th bst-table-column><span translate>Version</span></th>
21
21
  <th bst-table-column><span translate>Commit</span></th>
22
- <th bst-table-column><span translate>Date</span></th>
23
22
  </tr>
24
23
  </thead>
25
24
 
@@ -34,9 +33,6 @@
34
33
  <td bst-table-cell>
35
34
  {{ item.commit }}
36
35
  </td>
37
- <td bst-table-cell>
38
- {{ item.version_date }}
39
- </td>
40
36
  </tr>
41
37
  </tbody>
42
38
  </table>
@@ -28,8 +28,15 @@ angular.module('Bastion.sync-plans').controller('SyncPlanDetailsInfoController',
28
28
  $scope.editedInterval = false;
29
29
 
30
30
  function updateSyncPlan(syncPlan) {
31
- syncPlan.syncDate = new Date(syncPlan['sync_date']);
32
- syncPlan.syncTime = new Date(syncPlan['sync_date']);
31
+ var syncDate;
32
+ if (syncPlan['sync_date']) {
33
+ syncDate = new Date(syncPlan['sync_date'].replace(/\s/, 'T').replace(/\s/, ''));
34
+ } else {
35
+ syncDate = new Date();
36
+ }
37
+
38
+ syncPlan.syncDate = syncDate;
39
+ syncPlan.syncTime = syncDate;
33
40
  $scope.syncPlan = syncPlan;
34
41
  }
35
42
 
@@ -18,7 +18,7 @@
18
18
  </dd>
19
19
 
20
20
  <dt translate>Start Date</dt>
21
- <dd bst-edit-custom="syncPlan.sync_date"
21
+ <dd bst-edit-custom="syncPlan.syncDate"
22
22
  formatter="date"
23
23
  formatter-options="'medium'"
24
24
  on-save="save(syncPlan)"
@@ -8,6 +8,18 @@ namespace :katello do
8
8
  Katello::RootRepository.yum_type.find_each do |root_repo|
9
9
  root_repo.transaction do
10
10
  begin
11
+ if [::Runcible::Models::YumImporter::DOWNLOAD_ON_DEMAND, ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND].include?(root_repo.download_policy) && root_repo.url.present? && URI(root_repo.url).scheme == 'file'
12
+ root_repo.update_attribute(:download_policy, ::Runcible::Models::YumImporter::DOWNLOAD_IMMEDIATE)
13
+ root_repo.repositories.each do |repo|
14
+ importer = repo.importers[0]
15
+ config = {
16
+ :download_policy => ::Runcible::Models::YumImporter::DOWNLOAD_IMMEDIATE
17
+ }
18
+
19
+ SmartProxy.pulp_master.pulp_api.resources.repository.update_importer(repo.pulp_id, importer[:id], config) if (importer && importer[:id])
20
+ end
21
+ end
22
+
11
23
  if root_repo.on_demand? && root_repo.url.present?
12
24
  root_repo.update_attribute(:checksum_type, nil)
13
25
 
@@ -1,3 +1,3 @@
1
1
  module Katello
2
- VERSION = "3.11.0".freeze
2
+ VERSION = "3.11.1".freeze
3
3
  end
@@ -25,7 +25,7 @@ export const getOrganiztionsList = () => (dispatch) => {
25
25
  });
26
26
  };
27
27
 
28
- export const changeCurrentOrgaziation = orgID => dispatch => foremanEndpoint
28
+ export const changeCurrentOrganization = orgID => dispatch => foremanEndpoint
29
29
  .get(`organizations/${orgID}/select`)
30
30
  .then(() => {
31
31
  dispatch({
@@ -34,12 +34,12 @@ class SetOrganization extends Component {
34
34
  onSend() {
35
35
  const {
36
36
  history,
37
- changeCurrentOrgaziation,
37
+ changeCurrentOrganization,
38
38
  redirectPath,
39
39
  } = this.props;
40
- const { id, item } = this.state;
40
+ const { id } = this.state;
41
41
 
42
- changeCurrentOrgaziation(encodeURIComponent(`${id}-${item}`)).then(() =>
42
+ changeCurrentOrganization(`${id}`).then(() =>
43
43
  history.push({
44
44
  pathname: redirectPath,
45
45
  state: { orgChanged: this.state.item },
@@ -95,7 +95,7 @@ class SetOrganization extends Component {
95
95
  SetOrganization.propTypes = {
96
96
  list: PropTypes.arrayOf(PropTypes.object),
97
97
  loading: PropTypes.bool.isRequired,
98
- changeCurrentOrgaziation: PropTypes.func.isRequired,
98
+ changeCurrentOrganization: PropTypes.func.isRequired,
99
99
  history: PropTypes.shape({}).isRequired,
100
100
  redirectPath: PropTypes.string.isRequired,
101
101
  getOrganiztionsList: PropTypes.func.isRequired,
@@ -1,41 +1,175 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`subscriptions page should render select org page 1`] = `
4
- <CheckOrg>
5
- <Header
6
- title="Select Organization"
4
+ <Connect(CheckOrg)
5
+ store={
6
+ Object {
7
+ "clearActions": [Function],
8
+ "dispatch": [Function],
9
+ "getActions": [Function],
10
+ "getState": [Function],
11
+ "replaceReducer": [Function],
12
+ "subscribe": [Function],
13
+ }
14
+ }
15
+ >
16
+ <CheckOrg
17
+ default={[Function]}
18
+ loadOrganization={[Function]}
19
+ organization={Object {}}
20
+ saveOrganization={[Function]}
21
+ store={
22
+ Object {
23
+ "clearActions": [Function],
24
+ "dispatch": [Function],
25
+ "getActions": [Function],
26
+ "getState": [Function],
27
+ "replaceReducer": [Function],
28
+ "subscribe": [Function],
29
+ }
30
+ }
31
+ storeSubscription={
32
+ Subscription {
33
+ "listeners": Object {
34
+ "clear": [Function],
35
+ "get": [Function],
36
+ "notify": [Function],
37
+ "subscribe": [Function],
38
+ },
39
+ "onStateChange": [Function],
40
+ "parentSub": undefined,
41
+ "store": Object {
42
+ "clearActions": [Function],
43
+ "dispatch": [Function],
44
+ "getActions": [Function],
45
+ "getState": [Function],
46
+ "replaceReducer": [Function],
47
+ "subscribe": [Function],
48
+ },
49
+ "unsubscribe": [Function],
50
+ }
51
+ }
7
52
  >
8
- <HelmetWrapper
9
- defer={true}
10
- encodeSpecialCharacters={true}
53
+ <Header
54
+ title="Select Organization"
11
55
  >
12
- <SideEffect(NullComponent)
56
+ <HelmetWrapper
13
57
  defer={true}
14
58
  encodeSpecialCharacters={true}
15
- title="Select Organization"
16
- titleAttributes={Object {}}
17
59
  >
18
- <NullComponent
60
+ <SideEffect(NullComponent)
19
61
  defer={true}
20
62
  encodeSpecialCharacters={true}
21
63
  title="Select Organization"
22
64
  titleAttributes={Object {}}
23
- />
24
- </SideEffect(NullComponent)>
25
- </HelmetWrapper>
26
- </Header>
27
- <Connect(withRouter(SetOrganization))
28
- redirectPath="/test"
29
- />
30
- </CheckOrg>
65
+ >
66
+ <NullComponent
67
+ defer={true}
68
+ encodeSpecialCharacters={true}
69
+ title="Select Organization"
70
+ titleAttributes={Object {}}
71
+ />
72
+ </SideEffect(NullComponent)>
73
+ </HelmetWrapper>
74
+ </Header>
75
+ <Connect(withRouter(SetOrganization))
76
+ redirectPath="/test"
77
+ />
78
+ </CheckOrg>
79
+ </Connect(CheckOrg)>
31
80
  `;
32
81
 
33
82
  exports[`subscriptions page should render the wrapped component 1`] = `
34
- <CheckOrg>
35
- <WrappedComponent>
36
- <div>
37
- Wrapped!
38
- </div>
39
- </WrappedComponent>
40
- </CheckOrg>
83
+ <Connect(CheckOrg)
84
+ store={
85
+ Object {
86
+ "clearActions": [Function],
87
+ "dispatch": [Function],
88
+ "getActions": [Function],
89
+ "getState": [Function],
90
+ "replaceReducer": [Function],
91
+ "subscribe": [Function],
92
+ }
93
+ }
94
+ >
95
+ <CheckOrg
96
+ default={[Function]}
97
+ loadOrganization={[Function]}
98
+ organization={Object {}}
99
+ saveOrganization={[Function]}
100
+ store={
101
+ Object {
102
+ "clearActions": [Function],
103
+ "dispatch": [Function],
104
+ "getActions": [Function],
105
+ "getState": [Function],
106
+ "replaceReducer": [Function],
107
+ "subscribe": [Function],
108
+ }
109
+ }
110
+ storeSubscription={
111
+ Subscription {
112
+ "listeners": Object {
113
+ "clear": [Function],
114
+ "get": [Function],
115
+ "notify": [Function],
116
+ "subscribe": [Function],
117
+ },
118
+ "onStateChange": [Function],
119
+ "parentSub": undefined,
120
+ "store": Object {
121
+ "clearActions": [Function],
122
+ "dispatch": [Function],
123
+ "getActions": [Function],
124
+ "getState": [Function],
125
+ "replaceReducer": [Function],
126
+ "subscribe": [Function],
127
+ },
128
+ "unsubscribe": [Function],
129
+ }
130
+ }
131
+ >
132
+ <WrappedComponent
133
+ default={[Function]}
134
+ loadOrganization={[Function]}
135
+ organization={Object {}}
136
+ saveOrganization={[Function]}
137
+ store={
138
+ Object {
139
+ "clearActions": [Function],
140
+ "dispatch": [Function],
141
+ "getActions": [Function],
142
+ "getState": [Function],
143
+ "replaceReducer": [Function],
144
+ "subscribe": [Function],
145
+ }
146
+ }
147
+ storeSubscription={
148
+ Subscription {
149
+ "listeners": Object {
150
+ "clear": [Function],
151
+ "get": [Function],
152
+ "notify": [Function],
153
+ "subscribe": [Function],
154
+ },
155
+ "onStateChange": [Function],
156
+ "parentSub": undefined,
157
+ "store": Object {
158
+ "clearActions": [Function],
159
+ "dispatch": [Function],
160
+ "getActions": [Function],
161
+ "getState": [Function],
162
+ "replaceReducer": [Function],
163
+ "subscribe": [Function],
164
+ },
165
+ "unsubscribe": [Function],
166
+ }
167
+ }
168
+ >
169
+ <div>
170
+ Wrapped!
171
+ </div>
172
+ </WrappedComponent>
173
+ </CheckOrg>
174
+ </Connect(CheckOrg)>
41
175
  `;
@@ -1,9 +1,19 @@
1
1
  import React, { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { bindActionCreators } from 'redux';
4
+ import { connect } from 'react-redux';
5
+
3
6
  import { translate as __ } from 'foremanReact/common/I18n';
4
7
  import { get } from 'lodash';
5
8
  import SetOrganization from '../SelectOrg/SetOrganization';
6
9
  import Header from '../../containers/Application/Headers';
10
+ import * as organizationActions from '../../scenes/Organizations/OrganizationActions';
11
+
12
+ const mapStateToProps = state => ({
13
+ organization: state.katello.organization,
14
+ });
15
+
16
+ const mapDispatchToProps = dispatch => bindActionCreators({ ...organizationActions }, dispatch);
7
17
 
8
18
  function withOrganization(WrappedComponent, redirectPath) {
9
19
  class CheckOrg extends Component {
@@ -31,10 +41,12 @@ function withOrganization(WrappedComponent, redirectPath) {
31
41
  }
32
42
 
33
43
  render() {
34
- const { location } = this.props;
44
+ const { organization, location } = this.props;
35
45
  const newOrgSelected = get(location, 'state.orgChanged');
36
46
 
37
47
  if (newOrgSelected) {
48
+ if (!organization.label && !organization.loading) { this.props.loadOrganization(); }
49
+
38
50
  return <WrappedComponent {...this.props} />;
39
51
  } else if (this.state.orgId === '') {
40
52
  return (
@@ -49,12 +61,15 @@ function withOrganization(WrappedComponent, redirectPath) {
49
61
 
50
62
  CheckOrg.propTypes = {
51
63
  location: PropTypes.shape({}),
64
+ loadOrganization: PropTypes.func.isRequired,
65
+ organization: PropTypes.shape({}).isRequired,
52
66
  };
53
67
 
54
68
  CheckOrg.defaultProps = {
55
69
  location: undefined,
56
70
  };
57
- return CheckOrg;
71
+
72
+ return connect(mapStateToProps, mapDispatchToProps)(CheckOrg);
58
73
  }
59
74
 
60
75
  export default withOrganization;