2

My team does predominantly back-end work in C#, with a smattering of front-end web development using Angular. We're starting a new website project, based on the Admin LTE framework / template. This is the first project we're doing which uses a framework / template like this.

The initial build of the site, as committed to source control, was over 2500 files - the vast, vast majority are from the Admin LTE template or its dependencies, and many of them are not related to nor will ever be used by our project. This has raised the question of whether or not these files belong in source control at all, and if so, where.

With a similar situation in C#, we'd use a Nuget package, add it to packages.config, and download it as needed. However, Admin LTE doesn't seem to exist as a Nuget package. It does exist in npm, though that is not part of our typical workflow / build process.

My strong thought is that we should not be keeping these files in source control at all, since they are not ours to maintain. On the other hand, web development is not my forte so is this is a normal thing in these kinds of projects?

If they don't belong in source control, do we need to update our processes to download it via npm and copy the files to where they belong? Add the git repo as a submodule / subtree? Something else?

asked May 28 at 2:32
1
  • "If they don't belong in source control, do we need to update our processes to download it via npm and copy the files to where they belong?" --- Yes. That's what you need to do. Commented May 28 at 16:50

3 Answers 3

3

Development of a web-app is not all that different from development of a back-end with regard to which files belong in your repository, which should be fetched from a external source and which can be left out completely.

  • If the file can be generated in a completely automated fashion in a reproducible way, it doesn't belong in source control. The files that it is generated from should instead be in source control.
  • If the file is part of a 3rd-party package that gets used completely unchanged, it is preferred to fetch it from the original source. Either from a package manager, or as a sub-module depending on how the original project is available.
  • If you have local changes to the file (or a file from the 3rd-party package), then it belongs in the local repository.
answered May 28 at 7:06
1
  • "If the file can be reproducibly generated in a completely automated fashion" Commented Jun 3 at 5:49
2

Bart's answer is surely correct, but let me elaborate on one thing. You wrote

Admin LTE doesn't seem to exist as a Nuget package. It does exist in npm, though that is not part of our typical workflow / build process.

So you have a 3rd party package, and I assume the file gets used completely unchanged, but you have trouble to "to fetch it from the original source", because you have only experience to do this with your favorite package manager. In such a case, think of other ways to get it into the build process. Maybe you have the 3rd party package available as a zip file archived on a local network share - then write a script which unzips this file at the correct place and make the script part of the build process. And of course, put this script under source control.

Such scripts may not be as convenient as a package manager, but they can be usually written with reasonable effort. This is a pragmatic solution which may be sufficient for your case. We did this for our C# projects already long before Nuget even exists (mainly for larger amount of test data, but also for larger 3rd party packages), and it has served us well.

answered May 28 at 15:25
0

Never assume that an online repository is going to be there forever. The project may shut down, or they may move to another version control system on a different server. Or they may decide that the code you use is obsolete and delete it.

Your source code repository should have all the sources that you need to build the project. That way if you park it for a few years, then come back to it for an update or bug fix, you can be confident that you can still rebuild everything.

answered Jun 3 at 8:35

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.