[RPC] Propose restructuring the repository folder structure #7458
Replies: 16 comments
-
I'm onboard with that idea - to separate module files from git/appveyor/younameit files. If we're moving code to src, there is also a dbatools C# project hidden inside the /bin/projects/ folder. It would make sense to move that project to the /src/ folder, as that's where it would be expected to live. But it would need one more folder level to separate those.
|
Beta Was this translation helpful? Give feedback.
-
Initially, we intentionally put the C# project in the current location because we offer features around rebuilding our library on import. Checking notes on the publishing process I see now that we no longer are publishing it to the PS Gallery. If @potatoqualitee wants to continue excluding it there is a good bit of code that we can clean up and simply remove the functionality. Reference/background:It was originally found users wanted to include the raw project for security scanning our code for vulnerabilities. Where places also had security reviews required before "software" could be installed they needed easy access to the raw code. So when Fred had the project setup and ready a configuration item was added for the import process to allow a building that library on the fly to replace the The FutureIf we are going to no longer publish the raw project with the module. I'd recommend actually moving that to a new repository. Then we can include an automation process to create formal releases of the library and pull those into the module repository as needed. We rarely even make changes to that library nowadays. |
Beta Was this translation helpful? Give feedback.
-
While we are at it, if we can do public/private instead of functions/internal, i'd dig. i do want to make 100000% sure everyone keeps their commit messages and attribution though |
Beta Was this translation helpful? Give feedback.
-
Commit history is kept intact by the git database file. GitHub may or may not always read that information in when you are viewing the history of the file, but it is there. |
Beta Was this translation helpful? Give feedback.
-
@Stuart-Moore @FriedrichWeinmann @nvarscar Any opinion on moving the project for the library to a dedicated repository? We can get a formal build process setup and have a GitHub Action run it. Would also allow us to publish it to the Nuget gallery if we wanted to, then just have the module pull it down in a build process or something. |
Beta Was this translation helpful? Give feedback.
-
I'm fine with that. I don't think there is a good reason to ship the C# source code with the module, as there are plenty 3rd party libs that are shipped with the module already. One more wouldn't make a difference. Having a base lib moved to its own repo - with a build pipeline and unit teats (if any) sounds like a good plan. |
Beta Was this translation helpful? Give feedback.
-
There is so much breaking just from moving the source code of the module 🦀 . I had no idea it was this bad. |
Beta Was this translation helpful? Give feedback.
-
@lancasteradam FYI this is in the works. I'm going to try and get the PR merged this coming week. Once that is done all forks of the repository will have to be updated. The cleanest way to do this:
This does a force reset instead of a merge, so the commit history stays cleaner. |
Beta Was this translation helpful? Give feedback.
-
@wsmelton, ok, sounds good, thanks. |
Beta Was this translation helpful? Give feedback.
-
@potatoqualitee so renaming folders for public/private breaks our configuration structure in the module. I'm also seeing the TEPP breaks even after I've updated folder path references. I'm not sure if @FriedrichWeinmann can look at what I have in that or could say why this would break? I get various messages about a function we have set as public, but lives in the private functions path (
A number of these as well; likely because the configurations failed to be brought into the session:
|
Beta Was this translation helpful? Give feedback.
-
Heya @wsmelton , So, if you rename the folders, it won't find them anymore and if you stop doing it in background runspaces, you get to see the errors. |
Beta Was this translation helpful? Give feedback.
-
I updated the paths where all files are referencing |
Beta Was this translation helpful? Give feedback.
-
I did notice the whole check for |
Beta Was this translation helpful? Give feedback.
-
Got it all figured out. |
Beta Was this translation helpful? Give feedback.
-
I do remove the source code before shipping! 🚢 I like the idea, but likely won't do it myself. |
Beta Was this translation helpful? Give feedback.
-
If anyone is interested in the result: https://github.com/wsmelton/dbatools/tree/folder-structure-1 |
Beta Was this translation helpful? Give feedback.
-
In conjunction with devcontainers being added in PR #6997, it is worth bringing up now that in order to get an automated build and release process set up we need to restructure the folders of this repository.
In most cases, an
src
folder contains the core base of the module. That would allow us to more easily build out the GitHub Action for doing a build script for releases and publishing to GitHub.This would be moving the following folders/files into the
src
folder:The new root folder of the module would be something like this:
Beta Was this translation helpful? Give feedback.
All reactions