Personally I use one one repository per client pro...
# sdf
e
Personally I use one one repository per client project (i.e. feature), and so each repo contains a single SDF project as well.
m
So the same client with two features would have two separate repos?
e
Yep
m
so this has been our current strategy. the nightmare has been two fold 1) managing dependencies and 2) creating some real guidance about when a “feature” should belong to a repo that some other feature should then depend on or when it should be split off into its own repo.
I should point out this is in-house development for a single company rather than multiple clients.
Moving to a monorepo style seems to feel like it would address the issues that arise about where a feature should live. But it presents a possible issue with deployment.
I’ve been toying with the creation of multiple
deploy.xml
files with a predictable naming structure and then creating a “control” script that renames the appropriate deploy definition file to
deploy.xml
and then hooks into the sutiecloud cli
I’m thinking this would allow everything to live in one repo and avoid the confusion about where it should be placed, while still allowing deployment of new features to be done granularly
e
What have been your biggest challenges with dependency management?
m
keeping them consistent
if we have a custom list as a dependency and that list is deployed inside a “core” repo
a feature repo (we refer to as extensions) is dependent on some core repo but the changed custom list isn’t updated that extension is now broken or using an outdated component
We currently divide repos into three types: Core: Repos that create and deploy NetSuite “primitives” like custom lists, forms, etc and are generally grouped by functionality/usage. Extensions: Repos that are a pretty well-defined and singular functionality that may have dependencies on more or more “Core” repos Suites: Repos that are sort of a collection of functionality related “Extensions” that might have some “glue” code intended to make them work together.
e
Interesting. Do you think it's really an all-or-nothing decision? It's either this way or a mono-repo?
m
no. I don’t think any of this is that strict
but I definitely don’t want to be maintaining to organization patterns in the long run
c
To me, there's 2 options: 1. On repo/project per "feature" 2. One repo/project per "client Breaking all of it up like this seems to be an artificial barrier for no real gain. NetSuite code isn't that re-useable so there's no real need to go nuts splitting everything out. If you need something for another project, you can take that from the other project later (unless its clearly reusable code obviously). Deploy should be smart enough to just not go crazy and start overwriting all of your stuff.
💯 1
m
This makes sense @creece and it follows what you’ve been saying @erictgrubaugh
I think a move to a monorepo makes sense as we don’t get any real benefit breaking it up the way we do.
c
Thats what I'd do. You could always try it for a project and see if it works well. I wouldn't start just converting everything until you give it a go.
e
Yeah I think if you are going to make a transition, it doesn't necessarily have to be all at once
c
When you want the part 2 of this discussion (branching), let me know 😄
m
well versioning was actually one of the original reasons we settled on the polyrepo model.
we could version things independent of each other. but branching…geesh. I’m actually curious @creece. What is your strategy?
c
Isn't that a nightmare? With several different repos, you'll have several different versions rather than single versions of apps. Like if your core repo is 1.0 but your extensions is is release 5 vs. just a single release with everything.
I just use simple gitflow
master/develop/feature branches etc...
💯 1
m
Early on it seemed like a single repo version was the more problematic choice – in hindsight, version changes don’t really matter – we don’t even have to do semantic versioning. We can leave the Changelog as documentation of what’s affected.
c
Especially for SDF, all of the changes are documented from commit to commit due to the objects and everything before declaratively defined.
You could have a 1.0 release tag and 2.0 release tag and easily do a diff
m
you’re right
this feels alot cleaner too
I think where we got hungup is out initial rollout of features was using SuiteBundler and packaging things that way was a nightmare to deploy or change
so that’s why when we adopted SDF we decided not to lump everything together – and it created all the aforementioned issues
c
I've used and recommend this article for how to branch for years (no ads/popups or anything just a nice to the point blog) https://nvie.com/posts/a-successful-git-branching-model/
m
looks like under SDF, combining everything is actually preferable
Oh I reference that article at least weekly.
c
Yes and no really for lumping it together. To erics point, you may want to do a particular feature for a client and keep that separate.
m
well we are in house development
so no multiple clients – just features to the company instance
c
So what works better for you? Keeping every "feature" separate? or just lumping it together? Combination of the 2?
I prefer it all together. I think eric breaks it out a little differently. Both work just fine as an example.
m
well hence the dicussion. we’ve had challneges with the polyrepo approach and only reservations with the monorepo approach but no real experience with it outside of being burnt when we used SuiteBundler for deployment
a
I work for a company with in house development as well and have had similar discussions with co-workers. I prefer keeping the features separate and customizing the deploy.xml file so I can deploy them without overwriting anything. On the other hand, it gets annoying when I have to deploy something between the dev SB, to the QA sb, to Prod where one file might be different between all three environments because of features being developed/QA'd/Deployed
m
this conversation seems to support that a monorepo approach will give us more benefits than we currently have. We would still need to work through the deployment strategy (guidance on how developers should modify their
deploy.xml
files so that only the feature they’re working on is getting deployed and tested.
or rather the SDF objects that affect their feature.
this article formed the basis of alot of my thinking about maybe monorepo was better.
e
The concerns are certainly different when all your development goes into one account.
But SDF certainly allows you to decouple your deployment from your repository structure, if you wish.
n
been using this concept. it can be a challenge having dynamic deployments, but you can also setup frequent projects using npm commands that seed your deploy.xml differently then the (bootstrap) template approach the article uses. note that this does use the gitflow @creece mentioned above, but it does so using git-flow git addons specifically.
s
I often take a simpler approach - monorepo, modify deploy.xml in a feature branch, then tag the repo as of that deployment when I merge it back to master. This gives the ability to recall the code and deploy.xml on any release. Just need a convention for tags to make it easy to find.
💯 1
I don't merge into master until feature has been accepted as done in production.
m
I like the modify
deploy.xml
in the feature branch. How do you account for that when it merges back to master. I assume master has the “full” project deploy @stalbert
b
I also prefer the use of a monolithic project for a single account vs. many feature repos. If you need to support multiple shared components across clients and projects I would recommend using a package manager like npm for versioning and distribution of components. Some kind of build pipeline is preferable for managing that kind of complexity though.
💯 1
s
in my case,
master
has whichever deploy.xml was last merged in from a feature branch - we don't even try to keep some sort of 'everything' deploy.xml. I considered that since outside of netsuite I subscribe to the notion of always deploying 'all the bits' to avoid missing anything. However SDF (and NS development) seems more aligned with smaller project deployments. As Brendan mentioned, we do use NPM for binary artifacts (libs like NFT).
💯 1
as for organization, I tend to put any projects more complex than one or maybe two scripts into a subfolder -so any project-only shared files, sample data, main scripts, etc. live in a subfolder named for the feature.
💯 1
m
Thanks for the insights @Brendan Boyd and @stalbert
👍 1