Skip to content

Commit

Permalink
Merge branch 'develop' into rhsm-non-rhel
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpunk authored Dec 18, 2023
2 parents 76b776c + 70b2144 commit 45c06ef
Show file tree
Hide file tree
Showing 233 changed files with 5,142 additions and 2,306 deletions.
5 changes: 5 additions & 0 deletions .github/matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"postgresql": ["12"],
"ruby": ["2.7"],
"node": ["14"]
}
4 changes: 4 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: pull_request
permissions:
contents: read

concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
container:
runs-on: ubuntu-latest
Expand Down
125 changes: 125 additions & 0 deletions .github/workflows/foreman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
name: Foreman

on:
pull_request:
push:
branches:
- 'develop'
- '*-stable'

env:
RAILS_ENV: test
DATABASE_URL: postgresql://postgres:password@localhost/test
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true
BUNDLE_WITHOUT: "console:development:journald"

concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
setup_matrix:
name: Setup matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build_matrix.outputs.matrix }}
steps:
- name: Build test matrix
id: build_matrix
uses: theforeman/gha-matrix-builder@v0

rubocop:
name: Rubocop
needs: setup_matrix
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: assets:console:development:dynflow_sidekiq:ec2:journald:jsonp:libvirt:openid:openstack:ovirt:redis:service:telemetry:vmware
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby[0] }}
bundler-cache: true
- name: Run rubocop
run: bundle exec rubocop -P

tests:
name: "${{ matrix.task }} - Ruby ${{ matrix.ruby }} and Node ${{ matrix.node }} on PostgreSQL ${{ matrix.postgresql }}"
runs-on: ubuntu-latest
needs:
- setup_matrix
- rubocop
services:
postgres:
image: 'postgres:${{ matrix.postgresql }}'
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_PASSWORD: password
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby }}
node: ${{ fromJson(needs.setup_matrix.outputs.matrix).node }}
postgresql: ${{ fromJson(needs.setup_matrix.outputs.matrix).postgresql }}
task:
- 'test:units'
- 'test:functionals'
- 'test:graphql'
- 'webpack:compile test:integration'
- 'db:seed'
- 'assets:precompile RAILS_ENV=production DATABASE_URL=nulldb://nohost'
steps:
- run: sudo apt-get update
- run: sudo apt-get -qq -y install build-essential libcurl4-openssl-dev zlib1g-dev libpq-dev libvirt-dev
- name: "Check out Foreman"
uses: actions/checkout@v4
- name: "Set up Ruby ${{ matrix.ruby }}"
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Archive Gemfile.lock
uses: actions/upload-artifact@v3
with:
name: Gemfile-ruby-${{ matrix.ruby }}-node-${{ matrix.node }}-pg-${{ matrix.postgresql }}.lock
path: Gemfile.lock
- name: "Set up Node ${{ matrix.node }}"
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Setup NPM Cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-
if: contains(matrix.task, 'compile')
- name: Generate package-lock.json
run: npm install --package-lock-only --no-audit
if: contains(matrix.task, 'compile')
- name: Archive package-lock.json
uses: actions/upload-artifact@v3
with:
name: package-lock-ruby-${{ matrix.ruby }}-node-${{ matrix.node }}-pg-${{ matrix.postgresql }}.json
path: package-lock.json
if: contains(matrix.task, 'compile')
- name: Install NPM packages
run: npm ci --no-audit
if: contains(matrix.task, 'compile')
- name: Prepare test env
run: |
bundle exec rake db:create
bundle exec rake db:migrate
- name: Run rake ${{ matrix.task }}
run: bundle exec rake ${{ matrix.task }}

result:
name: Test suite
runs-on: ubuntu-latest
needs: tests
steps:
- run: echo Test suite completed
31 changes: 21 additions & 10 deletions .github/workflows/js_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,41 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
setup_matrix:
name: Setup matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build_matrix.outputs.matrix }}
steps:
- name: Build test matrix
id: build_matrix
uses: theforeman/gha-matrix-builder@v0

test:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
runs-on: ubuntu-latest
needs: setup_matrix
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node-version:
- 12
- 14
matrix: ${{ fromJson(needs.setup_matrix.outputs.matrix) }}
steps:
- name: Checkout Foreman
uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Setup Node
uses: actions/setup-node@v3
ruby-version: ${{ matrix.ruby }}
- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node }}
- name: Generate npm dependencies package-lock
run: npm install --package-lock-only --no-audit
- name: Install npm dependencies
Expand All @@ -44,8 +56,7 @@ jobs:
run: npm run lint:custom
- name: Run tests
run: npm run test
- name: Publish Coveralls (node v14)
if: ${{ matrix.node-version == 14 }}
- name: Publish Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
52 changes: 34 additions & 18 deletions .github/workflows/plugins_react_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,65 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
setup_matrix:
name: Setup matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build_matrix.outputs.matrix }}
steps:
- name: Build test matrix
id: build_matrix
uses: theforeman/gha-matrix-builder@v0

test:
name: ${{ matrix.plugin }} with Ruby ${{ matrix.ruby }} and Node ${{ matrix.node }}
runs-on: ubuntu-latest
needs: setup_matrix
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- repo: katello
org: Katello
- repo: foreman-tasks
org: theforeman
ruby: ${{ fromJson(needs.setup_matrix.outputs.matrix).ruby }}
node: ${{ fromJson(needs.setup_matrix.outputs.matrix).node }}
plugin:
- theforeman/foreman-tasks
- Katello/katello
steps:
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '12.x'
node-version: ${{ matrix.node }}
# We could update the postinstall action for foreman to look for an environment variable for plugin webpack dirs
# before kicking off the ruby script to find them, this would eliminate the ruby dep and running `npm install` in plugins.
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: ${{ matrix.ruby }}
- name: Checkout Foreman
uses: actions/checkout@v4
with:
path: ./projects/foreman
path: ${{ github.workspace }}/projects/foreman
- name: Generate Foreman npm dependencies package-lock
run: npm install --package-lock-only --no-audit
working-directory: ${{ github.workspace }}/projects/foreman
- name: Install Foreman npm dependencies
run: npm ci --no-audit
working-directory: ${{ github.workspace }}/projects/foreman
- name: Checkout ${{ matrix.repo }}
- name: Checkout ${{ matrix.plugin }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.org }}/${{ matrix.repo }}
path: ./projects/${{ matrix.repo }}
- name: Generate ${{ matrix.repo }} npm dependencies package-lock
repository: ${{ matrix.plugin }}
path: ${{ github.workspace }}/projects/plugin
- name: Generate ${{ matrix.plugin }} npm dependencies package-lock
run: npm install --package-lock-only --no-audit
working-directory: ${{ github.workspace }}/projects/${{ matrix.repo }}
- name: Install ${{ matrix.repo }} npm dependencies
working-directory: ${{ github.workspace }}/projects/plugin
- name: Install ${{ matrix.plugin }} npm dependencies
run: npm ci --no-audit
working-directory: ${{ github.workspace }}/projects/${{ matrix.repo }}
- name: Run ${{ matrix.plugin_repo }} tests
working-directory: ${{ github.workspace }}/projects/plugin
- name: Run ${{ matrix.plugin }} tests
run: npm test
working-directory: ${{ github.workspace }}/projects/${{ matrix.repo }}
working-directory: ${{ github.workspace }}/projects/plugin
19 changes: 0 additions & 19 deletions .github/workflows/rubocop.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
inactive-prs:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
days-before-pr-stale: 90
days-before-issue-stale: -1
Expand All @@ -23,7 +23,7 @@ jobs:
impasse-prs:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
days-before-pr-stale: 30
days-before-issue-stale: -1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ npm-debug.log
.solargraph.yml
.nvmrc
mkmf.log
.yardoc/
6 changes: 3 additions & 3 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
- job: copr_build
trigger: pull_request
targets:
centos-stream-8:
additional_modules: "foreman:el8,nodejs:12"
rhel-8:
additional_modules: "foreman-devel:el8"
additional_repos:
- http://koji.katello.org/releases/yum/foreman-nightly/el8/x86_64/
- https://yum.theforeman.org/releases/nightly/el8/x86_64/
module_hotfixes: true

srpm_build_deps:
Expand Down
15 changes: 9 additions & 6 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[main]
host = https://www.transifex.com
host = https://app.transifex.com

[o:foreman:p:foreman:r:foreman]
file_filter = locale/<lang>/foreman.edit.po
source_file = locale/foreman.pot
source_lang = en
type = PO
replace_edited_strings = false
keep_translations = false

[foreman.foreman]
file_filter = locale/<lang>/foreman.edit.po
source_file = locale/foreman.pot
source_lang = en
type = PO
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Base container that is used for both building and running the app
FROM quay.io/centos/centos:stream8 as base
ARG RUBY_VERSION="2.7"
ARG NODEJS_VERSION="12"
ARG NODEJS_VERSION="14"
ENV FOREMAN_FQDN=foreman.example.com
ENV FOREMAN_DOMAIN=example.com

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gem 'ancestry', '~> 4.0'
gem 'scoped_search', '>= 4.1.10', '< 5'
gem 'ldap_fluff', '>= 0.5.0', '< 1.0'
gem 'apipie-rails', '>= 0.8.0', '< 2'
gem 'apipie-dsl', '>= 2.2.6'
gem 'apipie-dsl', '>= 2.6.1'
# Pin rdoc to prevent updating bundled psych (https://github.com/ruby/rdoc/commit/ebe185c8775b2afe844eb3da6fa78adaa79e29a4)
# Rails 6.0 is incompatible with Psych 4, Rails 6.1 should work
gem 'rdoc', '< 6.4'
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.0-develop
3.10.0-develop
2 changes: 0 additions & 2 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ $(document).on('click', 'a[disabled="disabled"]', function(event) {
});

function onContentLoad() {
tfm.store.observeStore('layout', tfm.nav.showContent);

if ($('input[focus_on_load=true]').length > 0) {
$('input[focus_on_load]')
.first()
Expand Down
Loading

0 comments on commit 45c06ef

Please sign in to comment.