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

dev/core#2000 Move afform into core extensions #18423

Merged
merged 359 commits into from
Sep 16, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Sep 9, 2020

Overview

Moving afform into core means we can start to recreate core forms as afforms, in particular where
they are problematic and / or hard to maintain.

Before

Maintained as separate repo

After

Maintained as part of core repo

Technical Details

Per https://lab.civicrm.org/dev/core/-/issues/2000 my understanding of the scope of this round of work is just to move it into core & wire it up. Future rounds of work will transition it from 'present' to installed - probably with installed happening first on buildkit installs. There are some technical issues for later rounds around the scenario where the extension is present in the core directory and in the extensions directory

Comments

We need to continue to have a lighter review requirement for afform while it's still not enabled on install

@civibot
Copy link

civibot bot commented Sep 9, 2020

(Standard links)

@civibot civibot bot added the master label Sep 9, 2020
@eileenmcnaughton
Copy link
Contributor Author

I re-ran civix & added a commit & also here https://lab.civicrm.org/extensions/afform/-/merge_requests/28/diffs

@totten
Copy link
Member

totten commented Sep 9, 2020

When we merge, I'd like to preserve history if we can, eg http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/

@eileenmcnaughton
Copy link
Contributor Author

@totten hmm OK - did we do that for any of the others?

@totten
Copy link
Member

totten commented Sep 9, 2020

Well, we haven't exactly done this a lot. :) For comparison:

  • civicrm-core's svn to git: We tried to migrate the history but couldn't get it to work. (IIRC, the migration scripts were crashing when trying to deal with the full history. The svn repo had a long history and an atypical topology.)
  • api4: For this migration, it was de-constructed so that it would not longer be an extension. I don't think we were clever enough to do the de-construction and also figure out history-migration at the same time.
  • flexmailer: No, though I feel like we could've done that better (because it's a simpler case). My guess is that the previous cases looked precedents.

Basically, if we have a situation where it is feasible to keep the history, then I think that's better.

(I'm experimenting here: https://gist.github.com/totten/5881476fdea542a57d60815da37ea3cf )

@totten
Copy link
Member

totten commented Sep 10, 2020

@eileenmcnaughton I've updated the migration script at https://gist.github.com/totten/5881476fdea542a57d60815da37ea3cf -- it gives a branch in which:

  • The base is civicrm-core.git@master
  • The folder ext/afform contains the content from afform.git
  • The full history from afform.git is reproduced for files in ext/afform.

Example output:

https://github.com/civicrm/civicrm-core/compare/master...totten:master-afform?expand=1

If the idea is to continue patching afform.git for the moment, then we can just re-run it when that's done.

@eileenmcnaughton
Copy link
Contributor Author

@totten @seamuslee001 not sure about the last 2 style warnings

@seamuslee001
Copy link
Contributor

@eileenmcnaughton
Copy link
Contributor Author

@totten with this merged to afform https://lab.civicrm.org/extensions/afform/-/merge_requests/30 style is solved - I think the next step is to close this & for you to do a replacement?

@eileenmcnaughton
Copy link
Contributor Author

@totten I see you just merged the PR into afform - what is the next step? Should I close this & you can do some magic?

colemanw and others added 21 commits September 15, 2020 19:13
Arguably afform still works on older versions but breaking changes have happened & if people
use it on older you want a buyer-beware type feeling
This means that data can be set in an embedded form e.g

 <af-entity data='{name_a : options.name_a,  name_b : options.name_b, is_name_b_nickname: options.is_name_b_nickname, is_name_b_inferior: options.is_name_b_inferior}' .... />

In this case the options.name_as comes from the directive that instantiates this afform
The afField.getOptions function was causing infinite recursion by recreating the boolean options array every time.
Passing this variable by refernce solves the problem, and adding "track by" to the ng-repeat follows best-practices for efficiency.
Civi 5.23 changes boolean options to be real true and false instead of '1' and '0'
so added version bump to keep in step.
This reverts commit d31206f9e08703ae4f11b7e34673d7ece92b1630.
I removed the commented out functions rather than figuring out how to style them right
@totten
Copy link
Member

totten commented Sep 16, 2020

@eileenmcnaughton I've re-run the migration script and force-pushed to your branch. So this PR now has a full history.

@eileenmcnaughton
Copy link
Contributor Author

eileenmcnaughton commented Sep 16, 2020

@seamuslee @Coleman afform PR is now passing. It was in last week's dev digest so we have communicated about it- but I think one of you should merge as it's technically my PR but all the commits were added by @totten

@colemanw colemanw merged commit 33e22ac into civicrm:master Sep 16, 2020
@colemanw colemanw deleted the afform branch September 16, 2020 14:44
@colemanw
Copy link
Member

Merged. I also archived the gitlab repo to avoid confusion.

@eileenmcnaughton
Copy link
Contributor Author

Cool - so test wiring just needs doing

@colemanw
Copy link
Member

@totten can you pls enable the afform tests on core CI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants