Merge solidus_starter_frontend into the monorepo#6468
Conversation
CI Strategy Redesign
Rename route from /cart/edit to /cart
In the test command we used to have this default, but it's useless because we are always passing it when invoking the command in the run-specs job (see line 86). Having the default version in a single place will allow us to change it only once when we create a new version branch and we need to make its test suite point to a specific solidus version.
…-followup Remove solidus branch default value
…preview Add a store preview image on top of the README
For SSF, there's no need of using a dynamically named folder because each combination will run in a separate job. This was needed on extensions, when the combination of solidus versions were run as different tasks on the same job.
…sults-folder Streamline test results storage folder
This feature uses stimulus to submit the form on every key pressed in the search input (if > 2 chars) and add some UX to navigate the results. Turbo stream will take care of updating the results section with the suggestions retrieved from the new specific controller action introduced. The search box changed a bit for this change. Other than the stimulus attributes now required, the taxons filter, which was already hidden, has been removed from the search form. This required to change the cache specs, because that taxons list is not generating a new cache rewrite anymore.
…e-search Autocomplete main search with products and taxons
We're bumping the browser-tools-orb version to fetch the fix implemented at CircleCI-Public/browser-tools-orb#63. The issue was due to chromedriver adding a file within the project directory, making it impossible to checkout our code there in a following step. To be on the safe side for future possible regressions, we're moving our checkout step to the top of the stack to ensure it finds a pristine directory. Closes solidusio#315
…heckout_on_ci Fix checkout step on CircleCI
We now have features that are only compatible with the last version of Rails and we are assuming the project will be only installed on the latest. This change let the installer exit if a previous version is detected, printing a message that asks to retry with latest Rails.
…-7-plus Abort installation when Rails < 7
We were storing the Slack secrets on a CircleCI context [1]. Although we were also passing them to forks [2], it resulted on unauthorized builds for external contributions. We could work around the issue in two ways: - Having the secrets outside of any context, but that would compromise the security of the associated Slack channel for: - Send messages as @circleci notifications - Send messages to channels @circleci notifications isn't a member of - Upload, edit, and delete files as CircleCI notifications - Using CircleCI logic statements [3] to conditionally run jobs when `CIRCLECI_USERNAME` or `CIRCLE_PR_USERNAME` env vars [4] are in a list of allowed users. However, that would be something difficult to maintain, and there's no other way to check the user's role. Given that we don't find those trade-offs to be acceptable, we remove the integration for now. [1] - https://circleci.com/docs/contexts/ [2] - https://circleci.com/docs/oss/#pass-secrets-to-builds-from-forked-pull-requests [3] - https://circleci.com/docs/configuration-reference/#logic-statements [4] - https://circleci.com/docs/variables/
…e_slack_not Remove Slack notifications for CI failures
Fixes solidusio#313 By clicking on one of the results item, the focusout event is triggered and it acts before the click event is triggered, removing the list. To solve this, we listen to all click events and do nothing if the click is internal to the autcomplete, otherwise it resets it.
…e-mouse-click Fix clicking on autocomplete results
By adding a wait_for_autocomplete helper method.
In order to use the main one in our organization's .github repository.
…template Remove custom PR template
…ch-specs Polish search autocomplete specs
In the order details page shown for the confirmation step and the order complete page the billing address should be more visually related to the payment.
Also show the payment state, near the payment.
Code readability and (basic) UX improvements
Probably a legacy of an older layout.
For parity with the new card / payment method partials in which the radio buttons are external to the partials provided by the payment methods.
In a real world scenario this would probably hold instructions on where to send the check. This work both as a placeholder and to visually balance the check with other payment methods.
Previously this test would fail because it couldn't get past the address step because shipping wasn't set up properly.
Some order updater methods were renamed as part of the in-memory order updater work. This caused this test to fail because the instance double wasn't set up for the new method.
Clicking links and then immediately navigating to another page before the previous link resolves creates a race condition which causes flaky tests.
I can't figure out why there needs to be a wait here but this test fails because the address doesn't get filled in without this. The fill_addresses_fields_with helper successfully focuses each field and calls fill_in with the correct value but nothing is actually typed into the field. Something is happening on page load that prevents these from being filled in but visually it doesn't seem like there's anything to check for so I resorted to just trying over and over and checking whether the text actually gets typed in.
Now that solidus_starter_frontend lives under starter_frontend/ in this monorepo, rewire the installer to fetch the template from solidusio/solidus instead of the standalone solidusio/solidus_starter_frontend repo. Update the release-time ref-bumping script accordingly.
The Solidus installer workflow already exercises the --frontend=starter install path. Extend it to also run the starter frontend's own rspec suite against the freshly-installed host app, so SSF's tests are covered in the monorepo's CI without needing a separate workflow.
The SSF CI workflow delegated to solidusio/test-solidus-extension, which clones a released solidus_core from RubyGems rather than using the in-tree version. Now that solidus_installer.yml runs the SSF spec suite against the in-tree Solidus (see previous commit), this standalone workflow is redundant. Remove starter_frontend/.github/ entirely.
|
I've opened the draft to begin dealing with GitHub Actions integration issues. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6468 +/- ##
==========================================
- Coverage 89.66% 89.62% -0.05%
==========================================
Files 990 991 +1
Lines 20793 20845 +52
==========================================
+ Hits 18645 18683 +38
- Misses 2148 2162 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Previously, the installer fetched the SSF template from a URL with a hardcoded ref that had to be bumped at release time by a dedicated script. Derive the ref from Spree.solidus_version instead: released versions resolve to their matching patch branch (e.g. v4.8), prereleases and missing versions fall back to main. CI can override via SOLIDUS_STARTER_FRONTEND_TEMPLATE to test against the in-tree template, which the installer workflow now does. This removes the need for bin/release/bump-starter-frontend-version and the corresponding steps in prepare_release.yml / prepare_post_release.yml.
Two changes to starter_frontend/template.rb:
1. Skip git clone when the template is applied from a local path. In the
standalone-repo layout, file://#{File.dirname(__FILE__)} happened to
be a git repo, so `git clone` worked. In the monorepo,
starter_frontend/ is a plain subdirectory and the clone fails. Set
source_paths directly from File.dirname(__FILE__)/templates when
running locally.
2. Replace the legacy URL parser
(/<owner>/solidus_starter_frontend/raw/<ref>/template.rb) with the
monorepo parser (/<owner>/<repo>/raw/<ref>/starter_frontend/template.rb).
When parsing succeeds, clone the referenced repo at the referenced
ref and use starter_frontend/templates/ as the source directory.
Unrecognized URL shapes now abort with a clear message.
Legacy support lives at solidusio/solidus_starter_frontend, which
continues to serve its old main branch for older solidus_core releases
that still have the legacy URL hardcoded.
We've started seeing spec failures due to the password manager in Chrome blocking after login due to insecure password. This should prevent that from happening. In addition this change disables the save address and credit card pop-ups that show up when running the browser in headed mode. We're also adding an extra assertion to ensure page is fully loaded before proceeding in the authentication spec. Co-authored-by: Alistair Norman <alistair@super.gd>
We were optimistically assuming that the page has already loaded and this was causing some flaky specs. Co-authored-by: Alistair Norman <alistair@super.gd>
This change adds a waiting matcher for the text on the page, instead of asserting on the current_path which causes race conditions and flakiness. Co-authored-by: Alistair Norman <alistair@super.gd>
These two tests could be combined into one more reliable test that ensures the confirmation page is already fully loaded before reloading it to check that the flash is no longer displayed. Co-authored-by: Alistair Norman <alistair@super.gd>
These tests were failing periodically. They test various different country/state requirements. These requirements can all be amalgamated for the sake of speed and simplicity. I think having the positive checks on css before the negative checks will eliminate the flaky failures.
This is different in different versions now so in order to get CI passing for all supported versions we need this check.
We need assertions after clicking links and visiting pages to make sure they have loaded.
This fails sometimes because there was nothing preventing a race condition here.
After we click the checkout button, we need to make sure the page is loaded before we visit another page. Co-authored-by: Alistair <alistair@super.gd> Co-authored-by: Chris <chris@super.gd>
We need to make sure the page is loaded before navigating to the next checkout step. Co-authored-by: Alistair <alistair@super.gd> Co-authored-by: Chris <chris@super.gd>
The solidus CI runs standardrb on the commits and the starter frontend gem we are pulling into the mono repo needs to conform to this. Co-authored-by: Alistair Norman <alistair@super.gd>
This fixes one more standardrb violation. Co-authored-by: Alistair Norman <alistair@super.gd>
This fixes the remaining violations that couldn't be fixed automatically. We also needed to update the exclusion for the sandbox app to also handle the one in the starter_frontend folder. Co-authored-by: Alistair Norman <alistair@super.gd>
|
@forkata We need to redo the subtree merge once the test suite fixes are in and then rebase our changes on that, right? |
I am not sure, but once we merge that branch we can try doing that 🤔 For now we wanted to pull in the spec fixes, so we just cherry-picked those commits. We tried to rebase on |
Summary
As the Starter Frontend has replace solidus_frontend as the primary frontend of Solidus, we want to bring it into monorepo. This helps centralize the maintenance of the project and surface compatibility issues as early as possible.
I have chosen to preserve the whole history of the project, so the PR looks a little scary. In reality, only the merge commit that merges the other history in and subsequent commits need to be reviewed.