Changing the Repository Structure #147
-
@AnssiR66, I suggest that before we merge the final release into While working on the new This change in structure (i.e. a source and a distribution folder) will actually make things easier in terms of the toolchain, since these two folders will be specular in structure, one containing the source files, the other the converted and sanitized output, both having the same directory structure. It would be a more intuitive layout to work with, compared to the current structure (which doesn't provide for library sources sanitation, which is why it doesn't have a symmetric source/build layout). The new structure will probably look something like this:
The reason why this has suddenly become a compelling issue (although it has been on my mind for a long time) is because the recent work on the documentation is introducing various AsciiDoc region-comments into the library sources, which we might wish to strip away from the distribution files — they don't look nice, and make the code less readable for end users who wish to study it, but they are really useful to us in maintaining the documentation always aligned with the library sources. I was also thinking that developers' annotations should use a special comment notation (e.g. comments starting in Tracking Generated Contents?I also believe that we should not track the distribution folder, since it's always built locally during development, and it would just consume space in the repository. But this choice largely depends on whether we wish to keep an online accessible version of the development-stage library files and HTML docs, or whether we should only focus on providing them via releases, via downloadable Zip archives that we attach to each release. In practical terms, if we diced to ignore the whole distribution/build folder, it will mean that the repository will no longer track generated files like the HTML documents. We'll keep tracking tests transcripts, though, since we need to track their changes in order to see how changes to code affect the output (and catch any undesired side effects), but the tests folder is not part of the source/distribution structure, it's a separate folder. If we end up ignoring the distribution folder, it will mean that the repository will no longer track any HTML file, so in order to visualize the documentation it becomes necessary to build the project locally — which now, thanks to the later adoption of Ruby Rake, has become a very simple operation, only requiring end users to type Personally, I think that once we've made our first public release of the new library (i.e. the new AsciiDoc toolchain, etc.), we probably won't have to worry about access to the HTML files — whereas right now their developer versions are all end users can rely on to study the new features. Chances that users will be in need to the development branch files are quite slim IMO, and in any case the new system is really easy to build locally: users don't need to understand anything about Ruby or Rake, they only need to install Ruby and Asciidoctor, and just type So, ultimately it boils down to how us maintainers wish to go about it, since it would also mean that in order to peak at the latest dev-docs we'd need to build the whole project locally. Surely, having a direct Live HTML link to access the state of any document (from any branch) is more practical, especially when a maintainer is not tracking the latest developments (as it's often the case in many ALAN projects, for whatever reasons, where often the various contributors and maintainers work at alternate periods on the project). The problem of tracking built files is mostly because of size bloat to the repository, but also because these files can introduce conflicts in rebase operations, etc. — in version controlled projects the general rule is to ignore any build artefacts, but there are exceptions to this rule (e.g. the transcripts in our E.g. we don't strictly need to track generated transcripts used in the documents toolchain either, but at least tracking them in the library source folder will provide us some insights in their changes, which might be alarm bells to the fact that the original text might need to be looked into, when the detected changes are considerable. Another consideration worth considering here is that the
As for the second point, we might want to do carry out this step manually (create the Zip files locally and upload them with each release), or we could do it automatically (via Travis CI or GitHub Actions) whenever a tagged release is created. Furthermore, we might consider creating two different distribution packages:
This last argument is also a reason why I don't think that storing the distribution files in the repository is particularly beneficial (aside from the HTML files), since any ALAN sources downloaded from GitHub will always have In any case, we can decide to track some files and omit others, or just track everything, according to whichever way seems more beneficial to us all. We don't have to decide right away on this aspect of what to track or ignore — even if I change the repository structure in the coming week, we still have time until the library release to decide on what to ignore and what to track. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
All of that sounds good, and I agree with this proposed plan of action. |
Beta Was this translation helpful? Give feedback.
-
New Structure in Practice@AnssiR66, I've now been working on the new repo structure for a few days and I think that it's now ready to be merged into the main dev branch (which, BTW, was renamed from I'm also buzzing @thoni56, since I'd like to probe if he has some tips on this, and to keep him updated on the upcoming library changes too. While implementing the new structure I've had a chance to test various solutions, and ultimately ended up changing the directory tree structure initially proposed, as well as some of the original folder names, because practical usage lead me to re-evaluate the folders tree in more practical terms. Definitely, having the library source and distribution folders share a symmetrical structure is a great improvement in many respects, and most important it's easier to manage and work with. New Repo StructureThis is the actual new repository structure now:
As you can see, there have been slight changes in the naming convention, compared to original proposal. These changes were motivated by how the package might develop in the future. New Package StructureSo, here's the explanation of the new structure of the distribution package:
I think that the new folders structure makes sense both in term of the actual contents as well as in view of contents that will be added in the future. Also, since now all documents are in HTML format, dynamic links between documents and to source files provide users with a quick and practical navigation system within the package. Since every PC has a browser, HTML is a good choice for documenting the package. I think it's a good idea to try and preserve a consistent structure between new versions of the library, or at least keep it familiar, which is why I opted to create the Organizing different types of contents into separate folders allows users to copy and paste assets they might want to reuse (e.g. the Of course, we can still change the folders structure or their names before release I'd like your opinion on the above choices, and if you think there are better ways to organize the various assets, and if there are some assets types I've overlooked, etc. In any case, I'm ready to merge the new structure into Tracking Dilemma: Let's Track!After thinking about the problem of whether to track in the repository the generated files or not, I've come to the conclusion that the benefits of tracking them outweigh the cons in this specific project. Here's why:
Having tried working with both approaches locally (ignore vs track), I quickly realized that tracking the distribution files is more practical. For example, now HTML documents are converted directly into their The new system is much cleaner and simpler:
|
Beta Was this translation helpful? Give feedback.
-
We can certainly discard testgame.alan and mygame_import.i which by now are outdated. The testgame is rather messy, and something else could be created instead. The readme file can be rewritten, it shouldn't be too great a job to do. |
Beta Was this translation helpful? Give feedback.
All of that sounds good, and I agree with this proposed plan of action.