Skip to content

Commit

Permalink
Update dependabot, README fixups (#5099)
Browse files Browse the repository at this point in the history
* dev guidelines update

* clean up obsolete pr checks

* npx npm-check-updates -t minor -x /monaco/ -u

* npm install

* stable-release: fix negative tag list

* no more eslintrc

* cleanup test/package.json

* README fixups

* rm package-lock.json test/package-lock.json ; npm install ; cd test; npm install

* update dependabot

* unused template

* drop empty api host

* explicit sort for static, no travis

* remove unused gateway config

Closes #5031

* less sensitive to missing gateway api
  • Loading branch information
himdel committed Jun 12, 2024
1 parent d77d224 commit 7dd03cb
Show file tree
Hide file tree
Showing 27 changed files with 124 additions and 1,576 deletions.
22 changes: 0 additions & 22 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

19 changes: 18 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,18 @@ updates:
patterns:
- "@babel/*"
- "babel-loader"
eslint:
patterns:
- "eslint"
- "eslint-config-*"
- "eslint-plugin-*"
- "typescript-eslint"
lingui:
patterns:
- "@lingui/*"
patternfly:
patterns:
- "@patternfly/*"
react:
patterns:
- "react"
Expand All @@ -30,11 +39,19 @@ updates:
babel:
patterns:
- "@babel/*"
- "babel-core"
- "babel-loader"
eslint:
patterns:
- "eslint"
- "eslint-config-*"
- "eslint-plugin-*"
- "typescript-eslint"
lingui:
patterns:
- "@lingui/*"
patternfly:
patterns:
- "@patternfly/*"
react:
patterns:
- "react"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Automerge

on:
pull_request_target:
branches: [ 'master', 'stable-*', 'feature/*' ]
branches: [ 'master', 'stable-*' ]

jobs:
automerge:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
# allow running manually
workflow_dispatch:
pull_request:
branches: [ 'master', 'stable-*', 'feature/*' ]
branches: [ 'master', 'stable-*' ]
push:
branches: [ 'master', 'stable-*', 'feature/*' ]
branches: [ 'master', 'stable-*' ]
# daily on master
schedule:
- cron: '30 5 * * *'
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/dev-gateway-release.yml

This file was deleted.

22 changes: 1 addition & 21 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,10 @@ name: "PR checks"

on:
pull_request:
branches: [ 'master', 'stable-*', 'feature/*' ]
branches: [ 'master', 'stable-*' ]

jobs:

check_commit:
runs-on: ubuntu-latest
if: ${{ github.base_ref == 'master' }}
steps:

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
fetch-depth: 0 # include all history

- name: Run script to validate commits for both pull request and a push
env:
GITHUB_PR_COMMITS_URL: ${{ github.event.pull_request.commits_url }}
GITHUB_USER: ${{ github.event.pull_request.user.login }}
START_COMMIT: ${{ github.event.before }}
END_COMMIT: ${{ github.event.after }}
run: |
curl https://raw.githubusercontent.com/ansible/galaxy_ng/master/.ci/scripts/validate_commit_message_custom.py | python
pr-checks:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ name: "Stable release"
on:
push:
tags:
- '[0-9]+.[0-9]+.**'
- '!dev'
- '!**cloud**'
- '[0-9]+.[0-9]+.*'
- '!dev*'
- '!cloud-*'
- '!crc-*'

concurrency:
group: stable-release-${{ github.ref }}
Expand Down
3 changes: 0 additions & 3 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
ls:
.travis:
.js: snake_case

.config.js: point.case
.d.ts: kebab-case
.js: kebab-case
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*.xml
.*.sw[po]
.DS_Store
.eslintrc
Dockerfile
test/cypress.env.json.template
test/cypress/e2e/*/compose.env
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ importOrder:
- '^[.][.]/app.scss'
- '<THIRD_PARTY_MODULES>'
- "^src/"
- "^static/"
- "^[./]"
importOrderSortSpecifiers: true
plugins:
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Ansible Automation Hub UI

Frontend for Ansible Hub and Galaxy. The backend for this project can be found at [ansible/galaxy\_ng](https://github.com/ansible/galaxy_ng/),
developer docs at [ansible.readthedocs.io](https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/), and an outdated wiki at [ansibe/galaxy_ng wiki](https://github.com/ansible/galaxy_ng/wiki/Development-Setup).
developer docs at [ansible.readthedocs.io](https://ansible.readthedocs.io/projects/galaxy-ng/en/latest/), and an outdated wiki at [ansibe/galaxy\_ng wiki](https://github.com/ansible/galaxy_ng/wiki/Development-Setup).

The project is built on React & Patternfly, using components from [patternfly-react](https://github.com/patternfly/patternfly-react) and [lingui](https://github.com/lingui/js-lingui/) for l10n.
The project is built on React & Patternfly, using components from [patternfly-react](https://github.com/patternfly/patternfly-react), with [lingui](https://github.com/lingui/js-lingui/) for l10n.


## Setting up Your Dev Environment
Expand Down Expand Up @@ -59,15 +59,15 @@ This app can be developed in standalone, community, or insights mode. Insights m

#### Modes

* `start-standalone`: assumes `oci/standalone`, http://localhost:8002/ui/ and http://localhost:55001/api/galaxy/
* `start-standalone`: assumes `oci/standalone` or `oci/dab`, http://localhost:8002/ui/ and http://localhost:55001/api/galaxy/
* `start-community`: assumes `oci/community`, http://localhost:8002/ui/ and http://localhost:5001/api/
* `start-insights`: assumes `oci/insights`, http://localhost:8002/preview/ansible/automation-hub/ and http://localhost:55001/api/automation-hub/
* **NOTE:** This option is only relevant to Red Hat employees.


### Tests

For more information about UI testing go to [test/README.md](https://github.com/ansible/ansible-hub-ui/tree/master/test/README.md).
For more information about UI testing go to [test/README.md](./test/README.md).

Set up:

Expand Down Expand Up @@ -95,14 +95,13 @@ List of all workflows:
- `backported-labels`: Add a backported-* label when a PR is backported to stable-*; on patchback merges
- `cypress`: Run Cypress integration tests; on PRs, pushes and cron
- `dev-release`: Build and upload to github releases, update `dev` tag; when master is updated
- `dev-gateway-release`: Build and upload to github releases, update `dev-gateway` tag; when master is updated
- `i18n`: Extract and merge l10n strings; cron
- `pr-checks`: Check for linter errors, obsolete package-lock.json and merge commits; on PRs only
- `stable-release`: Build and upload to github releases; when a stable release is created

List by branches:

- `master`: `backported-labels`, `cypress`, `dev-release`, `dev-gateway-release`, `i18n`, `pr-checks`, `stable-release`
- `master`: `backported-labels`, `cypress`, `dev-release`, `i18n`, `pr-checks`, `stable-release`
- `stable-*`: `backported-labels`, `cypress`, `i18n` (via cron from master), `pr-checks`, `stable-release`


Expand Down
2 changes: 1 addition & 1 deletion config/community.dev.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = webpackBase({
// Login URI to allow stand alone with and without keycloak
UI_EXTERNAL_LOGIN_URI: uiExternalLoginURI,

//required?
// required?
WEBPACK_PUBLIC_PATH: '/',

// Value for webpack.devServer.proxy
Expand Down
1 change: 0 additions & 1 deletion config/community.prod.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const webpackBase = require('./webpack.base.config');
// Compile configuration for stnadalone mode
module.exports = webpackBase({
API_BASE_PATH: '/api/',
API_HOST: '',
APPLICATION_NAME: 'Ansible Galaxy',
IS_COMMUNITY: true,
UI_BASE_PATH: '/ui/',
Expand Down
1 change: 0 additions & 1 deletion config/insights.prod.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const cloudBeta = process.env.HUB_CLOUD_BETA; // "true" | "false" | undefined (=

// Compile configuration for deploying to insights
module.exports = webpackBase({
API_HOST: '',
API_BASE_PATH: '/api/automation-hub/',
UI_BASE_PATH:
cloudBeta === 'true'
Expand Down
12 changes: 0 additions & 12 deletions config/standalone.gateway.prod.webpack.config.js

This file was deleted.

1 change: 0 additions & 1 deletion config/standalone.prod.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const webpackBase = require('./webpack.base.config');

// Compile configuration for stnadalone mode
module.exports = webpackBase({
API_HOST: '',
API_BASE_PATH: '/api/galaxy/',
UI_BASE_PATH: '/ui/',
UI_USE_HTTPS: false,
Expand Down
23 changes: 9 additions & 14 deletions config/webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const config = require('@redhat-cloud-services/frontend-components-config');
const {
default: { rbac, defaultServices },
} = require('@redhat-cloud-services/frontend-components-config-utilities/standalone/services');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const { execSync } = require('node:child_process');

Expand Down Expand Up @@ -52,19 +52,15 @@ module.exports = (inputConfigs) => {
const globals = {};

defaultConfigs.forEach((item) => {
// == will match null and undefined, but not false
if (inputConfigs[item.name] == null) {
customConfigs[item.name] = item.default;
} else {
customConfigs[item.name] = inputConfigs[item.name];
}
if (item.scope === 'global') {
globals[item.name] = JSON.stringify(
inputConfigs[item.name] || item.default,
);
}
customConfigs[item.name] = inputConfigs[item.name] ?? item.default;
});

defaultConfigs
.filter(({ scope }) => scope === 'global')
.forEach((item) => {
globals[item.name] = JSON.stringify(customConfigs[item.name]);
});

// 4.6+: pulp APIs live under API_BASE_PATH now, ignore previous overrides
globals.PULP_API_BASE_PATH = JSON.stringify(
customConfigs.API_BASE_PATH + 'pulp/api/v3/',
Expand Down Expand Up @@ -169,9 +165,8 @@ module.exports = (inputConfigs) => {
static: resolve(__dirname, '../static'),
},
},

// ignore editor files when watching
watchOptions: {
// ignore editor files when watching
ignored: ['**/.*.sw[po]'],
},
};
Expand Down
15 changes: 4 additions & 11 deletions developer_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ These are the rules we try to follow to make sure this project is as consistent

## Imports

### Ordering

Imports should be ordered as follows:

1. Any imports from 'react'
2. Stylesheets
3. Any imports from 3rd party libraries such as patternfly, lodash, etc.
4. Local imports

### Importing and exporting local components
Imports get automatically sorted by prettier. For local imports, make sure to import from
`src/SUBDIR` without the full path, or `./FILE`. Only use the file extension for scss &
images.

All components in local directories should be exported and imported via the index.ts file
at the directory's root.
Expand Down Expand Up @@ -58,7 +51,7 @@ Updating the params keyword should be done with the `ParamHelper` object found i
be used to update `params` as well as mixins that can be used to update the pages's
query params when the state changes.

An example of how this works is the `Sort` component (`src/components/patternfly-wrappers/sort.tsx`).
An example of how this works is the `Sort` component (`src/components/sort.tsx`).
This component loads the field being sorted and direction to sort by from `params['sort']`.
When the component is changed it calls the `updateParams` callback which updates the component's
`params` object, the page's query params and optionally calls the API with the new params to
Expand Down
Loading

0 comments on commit 7dd03cb

Please sign in to comment.