adobe / helix-cli

Command-line tools for developing with AEM
Apache License 2.0
49 stars 60 forks source link

aem 'import' should allow a branch #2426

Open atopper opened 1 week ago

atopper commented 1 week ago

Description Switch to a development or new feature branch is awkward when running aem import. The tests imply that it can be done through the ui-repo parameter (i.e. https://github.com/adobe/helix-importer-ui#somebranch) but that does not work.

This would be particularly useful when trying to socialize a new feature or bug fix, and reduce the effort to try it.

To Reproduce Steps to reproduce the behavior:

  1. Be able to run aem import successfully
  2. Pick a branch in https://github.com/adobe/helix-importer-ui/branches, say 'test'
  3. Try to start the importer with that branch: aem import --ui-repo https://github.com/adobe/helix-importer-ui#test)
  4. Start up fails

Expected behavior The Helix importer UI should start up and change branches to the specified test

Screenshots N/A

Version: Around 16.7.5

Additional context The use of the fragment in the UI isn't publicly advertised, so could be considered a feature (but a can't remove that label).

Example

C:\git\edge\aem-ascension>aem import --ui-repo=https://github.com/adobe/helix-importer-ui#test
    ___    ________  ___                                __
   /   |  / ____/  |/  /  (_)___ ___  ____  ____  _____/ /____  _____
  / /| | / __/ / /|_/ /  / / __ `__ \/ __ \/ __ \/ ___/ __/ _ \/ ___/
 / ___ |/ /___/ /  / /  / / / / / / / /_/ / /_/ / /  / /_/  __/ /
/_/  |_/_____/_/  /_/  /_/_/ /_/ /_/ .___/\____/_/   \__/\___/_/
                                  /_/ v16.5.15

AEM Importer UI needs to be installed.
Cloning https://github.com/adobe/helix-importer-ui#test in C:\git\edge\aem-ascension\tools\importer.
Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received:

<!DOCTYPE html>
<html
  lang="en"

  data-color-mode="auto" data-light-theme="light" data-dark-theme="dark"
  data-a11y-animated-images="system" data-a11y-link-underlines="true"

  >

  <head>
    <meta charset="utf-8">
  <link rel="dns-prefet...
kptdobe commented 1 week ago

You can do that ("manually"):

  1. run aem import
  2. go to ./tools/importer/helix-importer-ui
  3. git checkout <branch>
  4. build the current branch: npm run build
  5. reload the importer UI

This could be added to https://github.com/adobe/helix-importer-ui/blob/main/importer-guidelines.md#debugging

atopper commented 1 week ago

Yes @kptdobe, that's true. And then the user can add the --skip-ui to prevent checking out main again.

I find it is challenging to get people to try a new branch, and if we made it easy and reduce the steps by using ui-repo, perhaps even sending them the exact command line to run (i.e. aem import --ui-repo=https://github.com/adobe/helix-importer-ui#test), it would be easier for them to quickly try it, and to continue to use. Also then they would get updates on that branch automatically, instead of having to, again, go to the importer-ui code and pull. So it would mainly be for convenience, but I think a good convenience.

arumsey commented 6 days ago

I agree with @atopper that the "manual" approach adds too much friction to provide our customers with early access to new features. The aem cli should make it incredibly easy for users of the AEM Importer to access feature branches. The downside would be that it would be too easy to access branches that should not be used and it could encourage the proliferation of even more AEM Importer variations instead of simply focusing on integrating features into the core product.