-
Notifications
You must be signed in to change notification settings - Fork 38
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
Suggestion: Add UI to specifiy build file name #410
Comments
Hi Josh, A little background on this... Most build tools and technologies center around the source code files. You do your development directly in the source code files, merge and commit changes, and ultimately build your project from those source files. In most of those cases you have options to specify your build file name and path, but the build is an artifact of the source code. Microsoft Access is different in that the "build" is actually the development environment. You do most of your work directly in Microsoft Access and periodically/incrementally export the database to source files as a practical way to track changes and create a snapshot of source files that can be used to build the database to reflect a specific point in time. Because of this difference, the database maintains a much tighter relationship to the path of the source files. Version 4 includes a lot more conflict checking to make sure changes in the source files do not inadvertently overwrite modified database objects, and to ensure exports of database changes do not inadvertently overwrite source files that were modified from an external process. The This does bring up an interesting idea of adding a new option to "Build As..." a different database file. Kind of like a "Save As" operation in Office applications, or an "Export To" operation in an imaging software. This proposed feature would open a "Save As" dialog where you would specify a name and path for the database, and then build the database in the specified location without changing the index file or affecting the normal build. Let me know what you think about that idea... Workflow SuggestionsThinking through the workflow you described above, here are a couple suggestions/ideas I have found helpful: External Diff ToolI will often use WinMerge to compare two folders of source files. This lets me drill down into subfolders and easily compare the source differences between two different versions. Source files can be dragged and dropped between the folders, or even updated directly before building the database from source. Sometimes I will run an export, then rename the export folder and run an export again to generate a fresh copy of the export folder so I can review source changes between different versions of the database. You can also use two copies of the database file with different names, and compare the source folders for each version. Of course you will have some differences from the actual database file name, but just about everything else should match up pretty well. Git Branch MergingAnother approach is to export different versions of a database into different branches of a git repository. You can then use some of the built-in tools to review and resolve conflicts, and merge changes from one branch to another. I do something like this to manage this add-in project. I have a Hope that helps! |
Thanks for the prompt and in depth response. |
This will be used to build the current set of source files to a new file name or alternate location. #410
This allows a user to build the current database as a different file name to to a different location. If no database is open, the user is prompted to select a source files folder. #410
I haven't done extensive testing on this, but the new feature seems to work. I can build a database from source files to a new location and new file name without impacting the index or options of the selected source files. This should roll out with the next beta release, and you can try it out and let me know what you think. 😄 |
Built and installed the dev branch and tried Build As. I like it. The toolbar UI is great as well BTW. Thanks. Still trying to get my head wrapped around tight coupling of source and built file. I mean I understand of course that dev work is done in Access so coupling is important but in context of my 'compare two files' use case, it seems the coupling is more restrictive. For example, I find myself wanting to both select the source dir and also Build As another name. I haven't played with merge yet but it seems I may be able to do a similar compare workflow IF I were able to select a different source dir. Perhaps it will become more clear once I get used to it but it just seems selecting both source dir and build target would open all possibilities (with appropriate caveats and warnings of course regarding overwriting changes etc etc) Thanks for listening. PS - this is not criticism. I love your work. Just giving my $0.02 as a newbie to this great tool. |
FWIW, and this is just my opinion/suggestion. Up to now, the traditional approach has to been to make a separate copy of Access file every time we might make a major change or need to do experimentation. Carrying this habit over into git repository actually is counterproductive and defeat the point of having a git repository. To really leverage it, you should not have to make a separate source directory but rather have only single directory and maintain multiple git branches, which will then allow you to 1) seamlessly change from one branch to another, 2) do a diff between branches, 3) control when you are ready to merge one branch into another, 4) have a history of multiple commits available to help you analyze how one branch diverges from another branch. In other words, a different paradigm is needed when you want to compare sources. I understand the need for build as since it's simpler to have multiple built Just my $0.02ZWD. |
Good feedback thanks for taking the time. I don’t often use branches but should try more.
correct? thanks again. |
Yes, you get the idea. I'll add that when you are ready to merge, you would switch back to 'main', then pull from the 'source', which will then bring the 'main' up to the date with the 'source'. You can then delete the branch and then create a new branch. Furthermore, you would be able to selectively commit only what you want to ultimately merge into the 'main' branch. The exact process depends on how you do it/what git UI client tool you may but generally, you'd select only files or hunks (e.g. the changes within the file as shown in a diff tool) and commit only those changes. That way you can control what goes into the commit and ultimately is then pulled into another branch. HTH. |
Great suggestions! Just a couple more thoughts to add on the practical side... The default setup uses the Another tip to be aware of is that if you click I definitely second the recommendation to take advantage of the branching functionality in git. It really opens up the power of version control and source-based development workflows. The source files is really the only place you can practically and comprehensively compare different versions of a database. As you get more familiar with merging changes between various sets of source files, just keep in mind that a few areas like form and report layouts have sequential identifiers and won't play as well with complex merges. Changing control properties is fine, but if you are adding and removing controls, you want to keep those changes on the same branch. It is definitely a mental paradigm shift to think of the source files as the ultimate definition of a database project, but I have found this to be a rewarding transition. Instead of the "black box" of a binary database file where I often forget about little changes I made here and there, the source files in git provide a transparent visibility into every granular change I have made over time. I can also seamlessly collaborate with other developers. Integrating a change is as simple as accepting a PR and building (or merging) from source. |
This makes me think we could do a bit better in this area. The issue here is that when we checkout a branch, the At minimum, I think the add-in could at least track what branch the |
Was thinking the same thing but without much branching experience couldn't verbalize yet. Basically branching is good way to compare versions but the tight coupling problem still exists and in some ways is more apt to mistake without branch-binary relationship. |
off topic - should I open a discussion instead?
|
Let's keep the issues focused so for those questions, please start a new discussion, thanks! |
That is one of the key roles of the To me, it seemed that the most robust approach was to actually compare the database objects with the source files themselves, and use the index as a third element of comparison to determine whether it was the source files or database objects that changed. That's why most objects have a "hash" that would change when the object or source file is modified. This allows us to detect changes and display a conflict resolution dialog so the user can decide how they want to proceed. Since the index file is committed to version control alongside the source files, it stays in the relevant branch. Before switching to a new branch, I first export from the database to make sure all my changes are saved, then after switching to the new branch, I build from source to make sure my database reflects the current set of source files. The automatic backups and conflict resolution screens give me a bit of a safety net if I forget a step in this process. |
The struggle in my mind is going from Access where path/fileName is everything for version control, to source while two Access versions need the same name and same source dir. A lightbulb just went on for me.
I should just trust the tool but do agree with @bclothier it would help ones leap of faith to include branch name in the index file, and in the built Access file and a warning on Export if branch not matching the local repo. Thanks for listening. |
Thanks, Josh! This is helpful feedback. |
I know I'm late to the party (also this feature seems to work), but while I'd normally say "yah, branch diffing is the way to go", in the case of Access development, we've found Worktrees are really really handy. This allows us to have a |
Recently, I've been coming around to the idea of using feature flags in place of branching. Branching inevitably requires merging, which is often painless but can occasionally be agonizing. With feature flags, you hide your incomplete work behind some sort of boolean flag or--in the case of a new form or report--simply don't expose it in the user interface. Certain situations--like introducing a third-party dependency that requires an updated deployment process--still benefit from branching, but I'd say 95%+ of new development can be handled via feature flags. |
We also use feature flags, and combine them with branches as the "stable" and "beta" flags are set in the branch; we still require branches, especially for things that affect the underlying operation (not just new forms), which can affect more than just the UI, we've not found a "good" way to handle this, but I'm all ears for hearing about it. I keep meaning to share some of our build out process, but so many other things sit between that and me right now. |
This tool is great! Thank you!
It'd be nice to have the ability in the UI to changes the build file name - defaults to and updates the value in dbs-properties.json
Use case:
I find it helpful to compare changes between versions of Access files by using git diffs like so:
(would be interested if folks have similar or other workflows)
In the above case, the task is to examine and apply changes from source mdb to target mdb and then build target mdb. Sometimes the mdb files have different file names. In this case, a build from the updated target export dir builds an mdb having the source mdb name since the file name comes from the dbs-properties.json and vbe-project.json files which were overwritten from the source export (Step5). Additionally, the source mdb is backed up as expected. To build a file of a different name, you can change the file name values in the two aforementioned files before build.
It'd be nice to have the ability in the UI to changes the build file name - defaults to and updates the value in dbs-properties.json
Thanks for listening. Have a great day!
The text was updated successfully, but these errors were encountered: