katello 4.13.0.rc1 → 4.13.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 (103) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/registry/registry_proxies_controller.rb +334 -23
  3. data/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb +8 -0
  4. data/app/controllers/katello/api/v2/repositories_controller.rb +1 -1
  5. data/app/lib/actions/katello/capsule_content/sync_capsule.rb +7 -2
  6. data/app/lib/actions/katello/organization/manifest_delete.rb +6 -1
  7. data/app/lib/actions/katello/repository/create.rb +17 -11
  8. data/app/lib/actions/katello/repository/create_root.rb +4 -2
  9. data/app/lib/actions/katello/repository/discover.rb +11 -4
  10. data/app/lib/actions/katello/upstream_subscriptions/bind_entitlement.rb +1 -1
  11. data/app/lib/actions/pulp3/orchestration/orphan_cleanup/remove_orphans.rb +1 -0
  12. data/app/lib/actions/pulp3/orphan_cleanup/purge_completed_tasks.rb +15 -0
  13. data/app/lib/actions/pulp3/repository/create_publication.rb +4 -0
  14. data/app/lib/katello/repo_discovery.rb +4 -190
  15. data/app/lib/katello/resources/discovery/container.rb +127 -0
  16. data/app/lib/katello/resources/discovery/yum.rb +95 -0
  17. data/app/lib/katello/util/http_helper.rb +15 -0
  18. data/app/models/732bd3db9f64c621c64d2be4f2a838727aac0845.patch +61 -0
  19. data/app/models/katello/content_view.rb +2 -0
  20. data/app/models/katello/glue/pulp/repos.rb +8 -1
  21. data/app/models/katello/repository.rb +5 -1
  22. data/app/models/katello/repository.rb.bak +978 -0
  23. data/app/models/katello/root_repository.rb +14 -2
  24. data/app/models/katello/trace_status.rb +1 -1
  25. data/app/services/katello/pulp3/api/core.rb +8 -0
  26. data/app/services/katello/pulp3/api/docker.rb +4 -0
  27. data/app/services/katello/pulp3/content_view_version/import_validator.rb.bak +166 -0
  28. data/app/services/katello/pulp3/content_view_version/importable_repositories.rb.bak +164 -0
  29. data/app/services/katello/pulp3/repository/yum.rb +1 -6
  30. data/app/services/katello/repository_type.rb +1 -1
  31. data/app/views/foreman/smart_proxies/_content_tab.html.erb +3 -1
  32. data/config/initializers/monkeys.rb +0 -1
  33. data/db/migrate/20240520142245_add_container_push_props_to_repo.rb +7 -0
  34. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/checksum.service.js +6 -1
  35. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/details/views/repository-info.html +3 -0
  36. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/details/repositories/new/views/new-repository.html +0 -3
  37. data/lib/katello/plugin.rb +12 -0
  38. data/lib/katello/repository_types/docker.rb +1 -0
  39. data/lib/katello/repository_types/yum.rb +1 -0
  40. data/lib/katello/tasks/update_repository_expiry.rake +114 -0
  41. data/lib/katello/version.rb +1 -1
  42. data/lib/katello.rb +0 -2
  43. data/locale/bn/katello.po.time_stamp +0 -0
  44. data/locale/bn_IN/katello.po.time_stamp +0 -0
  45. data/locale/ca/katello.po.time_stamp +0 -0
  46. data/locale/cs/katello.po.time_stamp +0 -0
  47. data/locale/cs_CZ/katello.po.time_stamp +0 -0
  48. data/locale/de/katello.po.time_stamp +0 -0
  49. data/locale/de_AT/katello.po.time_stamp +0 -0
  50. data/locale/de_DE/katello.po.time_stamp +0 -0
  51. data/locale/el/katello.po.time_stamp +0 -0
  52. data/locale/en/katello.po.time_stamp +0 -0
  53. data/locale/en_GB/katello.po.time_stamp +0 -0
  54. data/locale/en_US/katello.po.time_stamp +0 -0
  55. data/locale/es/katello.po.time_stamp +0 -0
  56. data/locale/et_EE/katello.po.time_stamp +0 -0
  57. data/locale/fr/katello.po.time_stamp +0 -0
  58. data/locale/gl/katello.po.time_stamp +0 -0
  59. data/locale/gu/katello.po.time_stamp +0 -0
  60. data/locale/he_IL/katello.po.time_stamp +0 -0
  61. data/locale/hi/katello.po.time_stamp +0 -0
  62. data/locale/id/katello.po.time_stamp +0 -0
  63. data/locale/it/katello.po.time_stamp +0 -0
  64. data/locale/ja/katello.po.time_stamp +0 -0
  65. data/locale/ka/katello.po.time_stamp +0 -0
  66. data/locale/kn/katello.po.time_stamp +0 -0
  67. data/locale/ko/katello.po.time_stamp +0 -0
  68. data/locale/ml_IN/katello.po.time_stamp +0 -0
  69. data/locale/mr/katello.po.time_stamp +0 -0
  70. data/locale/nl_NL/katello.po.time_stamp +0 -0
  71. data/locale/or/katello.po.time_stamp +0 -0
  72. data/locale/pa/katello.po.time_stamp +0 -0
  73. data/locale/pl/katello.po.time_stamp +0 -0
  74. data/locale/pl_PL/katello.po.time_stamp +0 -0
  75. data/locale/pt/katello.po.time_stamp +0 -0
  76. data/locale/pt_BR/katello.po.time_stamp +0 -0
  77. data/locale/ro/katello.po.time_stamp +0 -0
  78. data/locale/ro_RO/katello.po.time_stamp +0 -0
  79. data/locale/ru/katello.po.time_stamp +0 -0
  80. data/locale/sl/katello.po.time_stamp +0 -0
  81. data/locale/sv_SE/katello.po.time_stamp +0 -0
  82. data/locale/ta/katello.po.time_stamp +0 -0
  83. data/locale/ta_IN/katello.po.time_stamp +0 -0
  84. data/locale/te/katello.po.time_stamp +0 -0
  85. data/locale/tr/katello.po.time_stamp +0 -0
  86. data/locale/vi/katello.po.time_stamp +0 -0
  87. data/locale/vi_VN/katello.po.time_stamp +0 -0
  88. data/locale/zh/katello.po.time_stamp +0 -0
  89. data/locale/zh_CN/katello.po.time_stamp +0 -0
  90. data/locale/zh_TW/katello.po.time_stamp +0 -0
  91. data/package.json +0 -1
  92. data/webpack/components/Content/ContentTable.js +0 -1
  93. data/webpack/components/Content/__tests__/__snapshots__/ContentTable.test.js.snap +0 -1
  94. data/webpack/global_test_setup.js.bak +59 -0
  95. data/webpack/scenes/ModuleStreams/ModuleStreamsPage.js +33 -39
  96. data/webpack/scenes/ModuleStreams/__tests__/ModuleStreamPage.test.js +4 -2
  97. data/webpack/scenes/ModuleStreams/__tests__/__snapshots__/ModuleStreamsTable.test.js.snap +0 -1
  98. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +4 -2
  99. metadata +87 -28
  100. data/lib/monkeys/anemone.rb +0 -33
  101. data/webpack/utils/__tests__/useParamsWithHash.test.js +0 -22
  102. data/webpack/utils/paramsFromHash.js +0 -16
  103. data/webpack/utils/useUrlParams.js +0 -14
data/lib/katello.rb CHANGED
@@ -8,7 +8,6 @@ require "gettext_i18n_rails"
8
8
  require "foreman-tasks"
9
9
  require "foreman_remote_execution"
10
10
  require "rest_client"
11
- require "anemone"
12
11
  require "securerandom"
13
12
 
14
13
  require "deface"
@@ -21,7 +20,6 @@ require lib_foreman if Dir.exist?(lib_foreman)
21
20
 
22
21
  require File.expand_path("../engines/bastion/lib/bastion", File.dirname(__FILE__))
23
22
  require File.expand_path("../engines/bastion_katello/lib/bastion_katello", File.dirname(__FILE__))
24
- require "monkeys/anemone"
25
23
 
26
24
  module Katello
27
25
  require "katello/version"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/package.json CHANGED
@@ -51,7 +51,6 @@
51
51
  "angular": "1.8.2",
52
52
  "bootstrap-select": "1.13.18",
53
53
  "ngreact": "^0.5.0",
54
- "query-string": "^6.1.0",
55
54
  "react-bootstrap": "^0.32.1",
56
55
  "use-deep-compare-effect": "^1.6.1"
57
56
  }
@@ -20,7 +20,6 @@ const ContentTable = ({ content, tableSchema, onPaginationChange }) => {
20
20
  loadingText={__('Loading')}
21
21
  >
22
22
  <Table
23
- ouiaId="content-table-table"
24
23
  columns={tableSchema}
25
24
  rows={results}
26
25
  pagination={pagination}
@@ -15,7 +15,6 @@ exports[`Content Table should render and contain appropriate components 1`] = `
15
15
  }
16
16
  itemCount={2}
17
17
  onPaginationChange={[Function]}
18
- ouiaId="content-table-table"
19
18
  pagination={Object {}}
20
19
  rows={
21
20
  Array [
@@ -0,0 +1,59 @@
1
+ import nock from 'nock';
2
+ import checkForOuiaIds from './ouia_id_check';
3
+
4
+ // runs before each test to make sure console.error output will
5
+ // fail a test (i.e. default PropType missing). Check the error
6
+ // output and traceback for actual error.
7
+ const originalConsoleError = global.console.error;
8
+ global.console.error = (error, stack) => {
9
+ originalConsoleError(error); // ensure error is printed to console, comment
10
+ // in case of ouia-id check
11
+
12
+ /* Uncomment block below to filter out PF4 ouiaId errors */
13
+ // const ignore = ['in ForwardRef (created by Tabs)',
14
+ // 'in Button (created by Label)', 'created by _default',
15
+ // 'created by PaginationOptionsMenu', 'created by TypeAheadItems',
16
+ // 'The prop `ouiaId` is marked as required in `Modal`, but its value is `undefined`',
17
+ // 'created by WizardHeader', 'created by Navigation',
18
+ // 'created by ActionsColumn', 'created by InactiveText', 'created by Select',
19
+ // 'created by Context.Consumer', 'created by DualListSelector'];
20
+
21
+ /* eslint-disable-next-line no-console */
22
+ if (stack) console.log(stack); // Prints out original stack trace
23
+
24
+ /* Uncomment block below to filter out PF4 ouiaId errors */
25
+ // if (error && !ignore.some(e => error.includes(e))) {
26
+ // originalConsoleError(error); // ensure error is printed to console
27
+ // console.log(stack); // Prints out original stack trace
28
+ // }
29
+
30
+ throw new Error(error); // comment this and uncomment the next line when checking for ouia ids
31
+ // if (!error.includes('Failed prop type')) throw new Error(error);
32
+ };
33
+
34
+ // Increase jest timeout as some tests using multiple http mocks can time out on CI systems.
35
+ jest.setTimeout(process.env.JEST_TIMEOUT || 15000);
36
+
37
+ // uncomment this to see if tests are trying to make real API requests
38
+ // beforeAll(() => {
39
+ // nock.disableNetConnect();
40
+ // });
41
+
42
+ afterAll(() => {
43
+ jest.resetModules();
44
+ if (global.gc) global.gc();
45
+ });
46
+
47
+ beforeEach(() => {
48
+ if (!nock.isActive()) { nock.activate(); }
49
+ });
50
+
51
+ // To see where you need to add ouiaIds:
52
+ // 1. uncomment this and the import above
53
+ checkForOuiaIds();
54
+ // 2. (optional) uncomment the line in global.console.error function above
55
+
56
+ afterEach(() => {
57
+ nock.cleanAll();
58
+ });
59
+
@@ -1,59 +1,53 @@
1
- import React, { Component } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import qs from 'query-string';
3
+ import { useUrlParams } from 'foremanReact/components/PF4/TableIndexPage/Table/TableHooks';
4
4
  import { translate as __ } from 'foremanReact/common/I18n';
5
5
  import { orgId } from '../../services/api';
6
6
  import TableSchema from '../ModuleStreams/ModuleStreamsTableSchema';
7
7
  import GenericContentPage from '../../components/Content/GenericContentPage';
8
8
 
9
- class ModuleStreamsPage extends Component {
10
- constructor(props) {
11
- super(props);
9
+ const ModuleStreamsPage = (props) => {
10
+ const { searchParam } = useUrlParams();
11
+ const [searchQuery, setSearchQuery] = useState(searchParam || '');
12
+ const { getModuleStreams } = props;
12
13
 
13
- const queryParams = qs.parse(this.props.location.search);
14
- this.state = {
15
- searchQuery: queryParams.search || '',
16
- };
17
- }
18
-
19
- componentDidMount() {
20
- this.props.getModuleStreams({
21
- search: this.state.searchQuery,
14
+ useEffect(() => {
15
+ getModuleStreams({
16
+ search: searchQuery,
22
17
  });
23
- }
18
+ }, [getModuleStreams, searchQuery]);
24
19
 
25
- onPaginationChange = (pagination) => {
26
- this.props.getModuleStreams({
20
+ const onPaginationChange = (pagination) => {
21
+ props.getModuleStreams({
27
22
  ...pagination,
28
23
  });
29
24
  };
30
25
 
31
- onSearch = (search) => {
32
- this.props.getModuleStreams({ search });
26
+ const onSearch = (search) => {
27
+ props.getModuleStreams({ search });
33
28
  };
34
29
 
35
- updateSearchQuery = (searchQuery) => {
36
- this.setState({ searchQuery });
30
+ const updateSearchQuery = (newSearchQuery) => {
31
+ setSearchQuery(newSearchQuery);
37
32
  };
38
33
 
39
- render() {
40
- const { moduleStreams } = this.props;
41
- return (
42
- <GenericContentPage
43
- header={__('Module Streams')}
44
- content={moduleStreams}
45
- tableSchema={TableSchema}
46
- onSearch={this.onSearch}
47
- autocompleteEndpoint="/katello/api/v2/module_streams"
48
- autocompleteQueryParams={{ organization_id: orgId() }}
49
- bookmarkController="katello_module_streams"
50
- updateSearchQuery={this.updateSearchQuery}
51
- initialInputValue={this.state.searchQuery}
52
- onPaginationChange={this.onPaginationChange}
53
- />
54
- );
55
- }
56
- }
34
+ const { moduleStreams } = props;
35
+ return (
36
+ <GenericContentPage
37
+ header={__('Module Streams')}
38
+ content={moduleStreams}
39
+ tableSchema={TableSchema}
40
+ onSearch={onSearch}
41
+ autocompleteEndpoint="/katello/api/v2/module_streams"
42
+ autocompleteQueryParams={{ organization_id: orgId() }}
43
+ bookmarkController="katello_module_streams"
44
+ updateSearchQuery={updateSearchQuery}
45
+ initialInputValue={searchQuery}
46
+ onPaginationChange={onPaginationChange}
47
+ />
48
+ );
49
+ };
50
+
57
51
 
58
52
  ModuleStreamsPage.propTypes = {
59
53
  location: PropTypes.shape({
@@ -1,19 +1,21 @@
1
1
  import React from 'react';
2
2
  import { shallow } from 'enzyme';
3
3
  import toJson from 'enzyme-to-json';
4
+ import * as hooks from 'foremanReact/components/PF4/TableIndexPage/Table/TableHooks';
4
5
  import ModuleStreamsPage from '../ModuleStreamsPage';
5
6
  import GenericContentPage from '../../../components/Content/GenericContentPage';
6
7
 
7
8
  describe('Module streams page', () => {
8
9
  it('should render and contain appropiate components', async () => {
9
10
  const moduleStreams = {};
10
- const mockLocation = { search: '' };
11
+ jest.spyOn(hooks, 'useUrlParams').mockImplementation(() => ({
12
+ searchParam: '',
13
+ }));
11
14
  const getModuleStreams = () => {};
12
15
 
13
16
  const wrapper = shallow(<ModuleStreamsPage
14
17
  moduleStreams={moduleStreams}
15
18
  getModuleStreams={getModuleStreams}
16
- location={mockLocation}
17
19
  />);
18
20
 
19
21
  expect(toJson(wrapper)).toMatchSnapshot();
@@ -88,7 +88,6 @@ exports[`Module streams table should render and contain appropiate components 1`
88
88
  }
89
89
  itemCount={0}
90
90
  onPaginationChange={[Function]}
91
- ouiaId="content-table-table"
92
91
  pagination={Object {}}
93
92
  rows={Array []}
94
93
  />
@@ -137,6 +137,8 @@ class ManageManifestModal extends Component {
137
137
  return name;
138
138
  };
139
139
 
140
+ const manifestExpiredMessage = manifestExpirationDate ? __('Your manifest expired on {expirationDate}. To continue using Red Hat content, import a new manifest.') : __('Your manifest has expired. To continue using Red Hat content, import a new manifest.');
141
+
140
142
  return (
141
143
  <ForemanModal id={MANAGE_MANIFEST_MODAL_ID} title={__('Manage Manifest')}>
142
144
  <Tabs id="manifest-history-tabs">
@@ -181,7 +183,7 @@ class ManageManifestModal extends Component {
181
183
  title={__('Manifest expired')}
182
184
  >
183
185
  <FormattedMessage
184
- defaultMessage={__('Your manifest expired on {expirationDate}. To continue using Red Hat content, import a new manifest.')}
186
+ defaultMessage={manifestExpiredMessage}
185
187
  values={{
186
188
  expirationDate: new Date(manifestExpirationDate).toDateString(),
187
189
  }}
@@ -198,7 +200,7 @@ class ManageManifestModal extends Component {
198
200
  {getManifestName()}
199
201
  </Col>
200
202
  </Row>
201
- {isManifestImported && manifestExpirationDate &&
203
+ {isManifestImported && Boolean(manifestExpirationDate) &&
202
204
  <Row>
203
205
  <Col sm={5} />
204
206
  <Col sm={7}>