Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Setup branding to be configurable during the build (#1664, #1742) #1738

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Mar 5, 2024

Summary

Refactor and enhance branding capabilities. Now branding is included
from a single directory that contains at least strings.json,
manifest.json, and favicon.ico. Any other assets may be placed in
the directory and will be copied to the bundled app.

Running the build as normal should show no difference.

Running the build with BRANDING=./some-other-brand npm run start:dev
will try to use a branding from the specified directory (that is relative to the
project's source root).

See BRANDING.md for more details.

Resolves: #1682

Details

Branding changes:

  • Move Konveyor branding assets to a project top-level branding directory

  • Remove MTA branding assets

  • Remove profile/branding constants from env and client module

  • Embed branding strings and assets in the common module

    • strings.json is templated to allow the build to adjust asset
      URL path roots as necessary
    • brandingAssetPath()
  • server's index.html generation sources the template strings from the
    common module's branding strings

  • HeaderApp and AppAboutModal components support branding by using
    the useBranding hook

  • BRANDING as a relative path is computed from the project root

  • webpack build source branding assets directly from the common module

  • Unit tests, snapshots and jest configs updated as necessary

Jest changes:

  • Use react-i18next mock from client/__mocks__ as a more robust mock
    borrowed from react-i18n repos

  • Move setupTests.ts into client/src/app/test-config to keep jest
    test config code all in the same directory

Related changes:

  • Upgrade rollup to v4, add new rollup plugins (copy, virtual)

Downgrade to rollup v3 for multiarch builds (#1742)

As a followup on PRs #1664 and #1739, it became necessary to downgrade
back to rollup@^3.0. The v4 of rollup has "native" code that runs the build, and
that code does not currently work with s390 builds [1]. Since konveyor is built
for x86, arm, ppc, and s390, all of those need to work.

When the s390 builds can work with the wasm bits, we can upgrade to
rollup@^4.0 again.

[1] - rollup/rollup#5354


Signed-off-by: Scott J Dickerson [email protected]
Co-authored-by: Ian Bolton [email protected]
Signed-off-by: Cherry Picker [email protected]

@ibolton336 ibolton336 closed this Mar 5, 2024
@ibolton336
Copy link
Member

Probably will have to get this in for 7.0.3 since it is a non-blocker.

@sjd78
Copy link
Member

sjd78 commented Mar 5, 2024

I'll setup a full backport with this PR and #1742 rolled together.

@sjd78 sjd78 deleted the cherry-pick-pr1664-release-0.3 branch March 5, 2024 16:16
@sjd78 sjd78 modified the milestone: v0.3.1 Mar 14, 2024
@sjd78 sjd78 restored the cherry-pick-pr1664-release-0.3 branch March 14, 2024 21:25
@sjd78
Copy link
Member

sjd78 commented Mar 14, 2024

Reopening for v0.3.1

I'll update the github actions files to current for the release-0.3 branch in another PR.

@sjd78 sjd78 reopened this Mar 14, 2024
@sjd78 sjd78 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2024
sjd78 and others added 2 commits March 14, 2024 19:33
## Summary
Refactor and enhance branding capabilities. Now branding is included
from a single directory that contains at least `strings.json`,
`manifest.json`, and `favicon.ico`. Any other assets may be placed in
the directory and will be copied to the bundled app.

Running the build as normal should show no difference.

Running the build with `BRANDING=./some-other-brand npm run start:dev`
will try to use a branding from the specified directory (that is relative to the
project's source root).

See `BRANDING.md` for more details.

Resolves: #1682

## Details
Branding changes:
  - Move Konveyor branding assets to a project top-level branding directory

  - Remove MTA branding assets

  - Remove profile/branding constants from `env` and client module

  - Embed branding strings and assets in the common module
    - `strings.json` is templated to allow the build to adjust asset
      URL path roots as necessary
    - `brandingAssetPath()`

  - server's index.html generation sources the template strings from the
    common module's branding strings

  - `HeaderApp` and `AppAboutModal` components support branding by using
    the `useBranding` hook

  - `BRANDING` as a relative path is computed from the project root

  - webpack build source branding assets directly from the common module

  - Unit tests, snapshots and jest configs updated as necessary

Jest changes:
  - Use `react-i18next` mock from `client/__mocks__` as a more robust mock
    borrowed from react-i18n repos

  - Move `setupTests.ts` into `client/src/app/test-config` to keep jest
    test config code all in the same directory

Related changes:
  - Upgrade rollup to v4, add new rollup plugins (copy, virtual)

---------

Signed-off-by: Scott J Dickerson <[email protected]>
Co-authored-by: Ian Bolton <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
Following up on PRs #1664 and #1739, downgrade to `rollup@^3.0`. The v4
of rollup has "native" code that runs the build, and that code does not
currently work with s390 builds [1]. Since konveyor is built for x86,
arm, ppc, and s390, all of those need to work.

When the s390 builds can work with the wasm bits, we can upgrade to
`rollup@^4.0` again.

[1] - rollup/rollup#5354

Signed-off-by: Scott J Dickerson <[email protected]>
@sjd78 sjd78 force-pushed the cherry-pick-pr1664-release-0.3 branch from 721a6c8 to 8ca2ef2 Compare March 14, 2024 23:37
@sjd78 sjd78 changed the title 🌱 Setup branding to be configurable during the build (#1664) 🌱 Setup branding to be configurable during the build (#1664, #1742) Mar 14, 2024
@sjd78 sjd78 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2024
@sjd78 sjd78 added this to the v0.3.1 milestone Mar 14, 2024
@sjd78 sjd78 merged commit 5b99704 into release-0.3 Mar 15, 2024
6 checks passed
@sjd78 sjd78 deleted the cherry-pick-pr1664-release-0.3 branch March 15, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants