diff --git a/.github/workflows/lockfileversion-check.yml b/.github/workflows/lockfileversion-check.yml index 916dcb40d2..4a3c01197c 100644 --- a/.github/workflows/lockfileversion-check.yml +++ b/.github/workflows/lockfileversion-check.yml @@ -5,7 +5,8 @@ name: Lockfile Version check on: push: branches: - - master + - next + - release-* pull_request: jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea00b8b40a..84b4fcbd4b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,10 @@ name: Release CI on: - workflow_dispatch: push: branches: - - master - - alpha - - beta + - next + - release-* jobs: release: name: Release diff --git a/.github/workflows/sync-master-alpha.yml b/.github/workflows/sync-23-next.yml similarity index 52% rename from .github/workflows/sync-master-alpha.yml rename to .github/workflows/sync-23-next.yml index 36d39e2ece..816c823818 100644 --- a/.github/workflows/sync-master-alpha.yml +++ b/.github/workflows/sync-23-next.yml @@ -1,8 +1,8 @@ -name: Sync alpha with master +name: Sync next with 23.x on: push: branches: - - master + - release-23.x workflow_dispatch: jobs: @@ -11,18 +11,23 @@ jobs: name: Syncing branches steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: '.nvmrc' - name: Create Pull Request id: cpr uses: tretuna/sync-branches@1.4.0 with: - GITHUB_TOKEN: ${{ secrets.requirements_bot_github_token }} - FROM_BRANCH: master - TO_BRANCH: alpha + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FROM_BRANCH: release-23.x + TO_BRANCH: next + - name: Auto-approve pull request for sync + uses: hmarr/auto-approve-action@v2 + with: + pull-request-number: ${{ steps.cpr.outputs.PULL_REQUEST_NUMBER }} + github-token: ${{ secrets.requirements_bot_github_token }} - name: Enable Pull Request Automerge uses: peter-evans/enable-pull-request-automerge@v2 with: diff --git a/.releaserc b/.releaserc index 50eab9763c..94b6f78223 100644 --- a/.releaserc +++ b/.releaserc @@ -1,9 +1,8 @@ { "branches": [ - "master", - "next", - { "name": "alpha", "prerelease": true }, - { "name": "beta", "prerelease": true } + { "name": "release-22.x", "range": "22.x", "channel": "22.x" }, + { "name": "release-23.x" }, + { "name": "next", "prerelease": true, "channel": "next" } ], "plugins": [ "@semantic-release/commit-analyzer", diff --git a/README.md b/README.md index c91f8e8029..827ce06072 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,14 @@ Note that if you are using ``@edx/frontend-platform``'s ``AppProvider`` componen ## Contributing +The branch to target with your PR depends on the type of change you are contributing to Paragon. + +| Branch to Target | Type of Change | Documentation Site | +| - | - | - | +| [`release-22.x`](https://github.com/openedx/paragon/tree/release-22.x) | Bug fix/security patch | https://paragon-openedx-v22.netlify.app/ | +| [`release-23.x`](https://github.com/openedx/paragon/tree/release-23.x) | Bug fix/security patch/new (non-breaking) feature | https://paragon-openedx-v23.netlify.app/ | +| [`next`](https://github.com/openedx/paragon/tree/next) | Breaking change | https://paragon-openedx.netlify.app/ | + Please refer to the ["How to Contribute"](https://openedx.org/r/how-to-contribute) documentation and [Code of Conduct](https://openedx.org/code-of-conduct/) from Open edX. The Paragon Working Group accepts bug fixes, new features, documentation, and security patches. You may find open issues [here](https://github.com/openedx/paragon/issues) or by visiting the Paragon Working Group [project board](https://github.com/orgs/openedx/projects/43/views/15). @@ -475,11 +483,6 @@ perf(pencil): remove graphiteWidth option BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reason. ``` -#### Opening Pull Requests for Breaking Changes - -Pull requests that include Breaking Changes must be opened against the `next` branch instead of `release-x.x`. -This ensures that breaking changes are accumulated and released together in the next major version, minimizing disruption for consumers. - ## Treeshaking Paragon is distributed on npm as ES6 modules. This means that webpack can use treeshaking on any Paragon components that a consuming app is not using, resulting in greatly reduced bundle sizes. diff --git a/package-lock.json b/package-lock.json index d83b197cd6..21a52a8d94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,7 +72,7 @@ "@babel/preset-env": "^7.16.8", "@babel/preset-react": "^7.16.7", "@babel/preset-typescript": "^7.16.7", - "@edx/eslint-config": "^4.2.0", + "@edx/eslint-config": "^4.3.0", "@edx/stylelint-config-edx": "^2.3.0", "@edx/typescript-config": "^1.1.0", "@formatjs/cli": "^5.0.2", @@ -2615,10 +2615,11 @@ "license": "UNLICENSED" }, "node_modules/@edx/eslint-config": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@edx/eslint-config/-/eslint-config-4.2.0.tgz", - "integrity": "sha512-2wuIw49uyj6gRwS74qJ8WhBU+X2FOP4uot40sthIC4YU9qCM7WJOcOuAhkRPP1FvZKd3UQH3gZM7eJ85xzDBqA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@edx/eslint-config/-/eslint-config-4.3.0.tgz", + "integrity": "sha512-4W9wFG4ALr3xocakCsncgJbK67RHfSmDwHDXKHReFtjxl/FRkxhS6qayz189oChqfANieeV3zRCLaq44bLf+/A==", "dev": true, + "license": "MIT", "peerDependencies": { "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", diff --git a/package.json b/package.json index e8a5687d62..bffbca60ba 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "@babel/preset-env": "^7.16.8", "@babel/preset-react": "^7.16.7", "@babel/preset-typescript": "^7.16.7", - "@edx/eslint-config": "^4.2.0", + "@edx/eslint-config": "^4.3.0", "@edx/stylelint-config-edx": "^2.3.0", "@edx/typescript-config": "^1.1.0", "@formatjs/cli": "^5.0.2", diff --git a/src/Card/CardFallbackDefaultImage.js b/src/Card/CardFallbackDefaultImage.js new file mode 100644 index 0000000000..e1df625d35 --- /dev/null +++ b/src/Card/CardFallbackDefaultImage.js @@ -0,0 +1 @@ +export const cardSrcFallbackImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXwAAACMCAYAAAB/AhJnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAH6SURBVHgB7dRBEYBADACxwuDf5j0QUXywiYhc7zk7APzd3gNAgvABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIoQPECF8gAjhA0QIHyBC+AARwgeIED5AhPABIp4BaNpp2Q/3/wfPkGyXOQAAAABJRU5ErkJggg=='; diff --git a/src/Card/CardImageCap.jsx b/src/Card/CardImageCap.jsx index e271246e43..eb27d912b2 100644 --- a/src/Card/CardImageCap.jsx +++ b/src/Card/CardImageCap.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import Skeleton from 'react-loading-skeleton'; import CardContext from './CardContext'; -import cardSrcFallbackImg from './fallback-default.png'; +import { cardSrcFallbackImg } from './CardFallbackDefaultImage'; const SKELETON_HEIGHT_VALUE = 140; const LOGO_SKELETON_HEIGHT_VALUE = 41; diff --git a/src/Card/fallback-default.png b/src/Card/fallback-default.png deleted file mode 100644 index b18d751d26..0000000000 Binary files a/src/Card/fallback-default.png and /dev/null differ diff --git a/src/Card/tests/CardImageCap.test.jsx b/src/Card/tests/CardImageCap.test.jsx index e459413d65..f0ef086d03 100644 --- a/src/Card/tests/CardImageCap.test.jsx +++ b/src/Card/tests/CardImageCap.test.jsx @@ -3,6 +3,7 @@ import renderer from 'react-test-renderer'; import { render, fireEvent, screen } from '@testing-library/react'; import CardImageCap from '../CardImageCap'; import CardContext from '../CardContext'; +import { cardSrcFallbackImg } from '../CardFallbackDefaultImage'; // eslint-disable-next-line react/prop-types function CardImageCapWrapper({ orientation = 'vertical', isLoading, ...props }) { @@ -119,13 +120,12 @@ describe('', () => { expect(logoImg.className).toEqual('pgn__card-logo-cap'); }); - it('hiding component if it isn`t fallbackSrc and src don`t work', () => { + it('renders the default image if both src and fallbackSrc fail to load', () => { render(); const srcImg = screen.getByAltText('Src alt text'); fireEvent.load(srcImg); fireEvent.error(srcImg); - // test-file-stub is what our fileMock.js returns for all images - expect(srcImg.src.endsWith('test-file-stub')).toEqual(true); + expect(srcImg.src).toEqual(cardSrcFallbackImg); }); });