Giter VIP home page Giter VIP logo

Comments (10)

ticean avatar ticean commented on May 21, 2024 1

Agree that we should add functionality to support a git checkout. I think it would be best to use an associative array for the project list. A project name and git ref to checkout. It would be good to also remove assumption of the Github organization too and add that to the project name.

from reaction-development-platform.

aldeed avatar aldeed commented on May 21, 2024

cc @ticean

from reaction-development-platform.

aldeed avatar aldeed commented on May 21, 2024

A related issue is that make doesn't prompt you for which branch of each repo to check out. It just starts cloning and building, which is a waste of time of you're going to have to stop the service, checkout a different release, and rebuild it after it's done.

from reaction-development-platform.

ticean avatar ticean commented on May 21, 2024

Some thoughts on how this could work:

The Makefile currently defines an array of projects. Most of the targets are created by some metaprogramming that iterate over the list. There are some global assumptions currently made in the file that need to be addressed.

  1. That all projects are in the reactioncommerce Github organization.
  2. That the master branch of each project will be used.

Proposed Solution

Declare data in a way that does not make these assumptions.

  1. If possible, use a multi-dimensional array to declare ($org/$project $git_ref). Or, find another workaround to get the data points into the targets.
  2. Modify the cloning targets so that the organization isn't hardcoded.
  3. Add a checkout step that would checkout to a git ref after clone.
  4. Modify the existing target meta templates to accept and use the various parts from the new data structure.

from reaction-development-platform.

focusaurus avatar focusaurus commented on May 21, 2024

So one thing I figured out as a note to self is we could in theory have one variable be a list of repo URLs and parse out the repo directory names as another variable like this:

[email protected]/reactioncommerce/reaction-hydra.git\#master \
		  [email protected]/reactioncommerce/reaction.git\#master \
		  [email protected]/reactioncommerce/reaction-next-starterkit.git\#master

# Yeah, there's a bunch of make and shell and sed escaping here. Sorry.
REACTION_PROJECT_NAMES=$(foreach rp,$(REACTION_PROJECT_URLS),$(shell basename $(rp) | cut -d \\\# -f 1 | sed 's/\.git$$//'))

That does seem to work BUT it uses unix stuff so is that a dealbreaker for windows installs?

from reaction-development-platform.

aldeed avatar aldeed commented on May 21, 2024

Make doesn't work on Windows anyway, does it?

@ticean I like your solution, and it should be keyed by version as well, i.e., platform version X = these 5 repos w/ checkout tags. In my perfect world, this would be defined in a separate file, ideally JSON or YAML. Not sure how easy it is to parse those in Make.

And on the subject of Make... I still think it would be better to find a different task runner that will work on any OS. Otherwise we are saying, "yeah we still support Windows, just use Docker" and "you should really use platform to bootstrap everything" but those statements are incompatible.

from reaction-development-platform.

focusaurus avatar focusaurus commented on May 21, 2024

OK I have a WIP pull request for adding checkout capabilities and a very simple manifest without much new code. Apologies about how inscrutable the make metaprogramming and escaping makes things, but I think it does what's strictly necessary here.

More broadly we should figure out our Windows story. As it is it's using GNU make which I believe doesn't directly work on Windows but there seem to be some cygwin-style ports. Dunno. But we're also using a handful of POSIX things like awk, xargs, cut, grep, etc so we'd at least have to require POSIX tools as a prereq.

I'd be OK with scripting things as node scripts or going all-docker if we start to run into limitations of only relying on basic text utilities.

from reaction-development-platform.

focusaurus avatar focusaurus commented on May 21, 2024

@aldeed revisiting your initial description of this feature, I guess we could add a data file for that. If we could use jq the data munging would be a lot less fidgety. Maybe JSON files like releases/2.0.json

{
  "subProjects": [
    {"name": "reaction-hydra", "gitUrl": "[email protected]:reactioncommerce/reaction-hydra.git", "tag": "2.0"},
    {"name": "reaction-next-starterkit", "gitUrl": "[email protected]:reactioncommerce/reaction-next-starterkit.git", "tag": "1.7"}
  ]
}

from reaction-development-platform.

focusaurus avatar focusaurus commented on May 21, 2024

Note to self: jq -r ".\"2.0\".subProjects[].gitUrl" < releases.json

from reaction-development-platform.

focusaurus avatar focusaurus commented on May 21, 2024

OK to keep scope well-tracked, I'm going to file a separate issue to discuss the toolchain choice. Let's keep this issue about a checkout command specifically. We may decide not to implement on top of the existing toolchain and Makefile.

from reaction-development-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.