Group projects within an organization - azure-devops

We used to structure projects on Gitlab in groups named after the client. Is it possible to group projects together in Azure DevOps within an organization? The desired state looks something like this
Organization
|
|- Company 1
| \
| |- Project for Company 1
| |- Project2 for Company 1
|
|- Company 2
| \
| |- Project for Company 2
Currently, the structure is flat
Organization
|
|- Project for Company 1
|- Project2 for Company 1
|- Project for Company 2

It is not, each project lives under the root organization.
What you would want to do is probably create a Team Project for each company, then use separate teams and area paths to split out the work items for each project. Work items can be split by subteam, but repos and pipelines roll up at the Team Project level so you would have to use the Team to limit access.
Organization
|
|- Company 1
| \
| |- Team for Project1 (which creates a new area path where the work items are stored)
| |- Team for Project2 (which creates a new area path where the work items are stored)
|
|- Company 2
| \
| |- Team for Project (which creates a new area path where the work items are stored)
See: https://learn.microsoft.com/en-us/azure/devops/organizations/projects/about-projects?view=azure-devops

Related

Github: Download artifact from any repository's Github actions workflow

I am trying to find a place to upload a binary that has to be executed in all the workflows that we run.
The problem that I am having is finding such a place.
I tried uploading the binary as a release. I am able to download this binary via the REST API but I have to pass in a personal access token to do so.
Is there a way to download a release artifact without passing in a personal access token on an internal repository that is visible to all the users in the organization?
-----------
| |
| bin.exe |
| |
-----------
/ | \
/ | \
----------- ------------ ------------
| | | | | |
| Repo 1 | | Repo 2 | | Repo 3 |
| | | | | |
----------- ------------ ------------
We have hundreds of repos and we want to pull the release artifact that is hosted in a different repo without passing in a personal access token because adding a personal access token is not feasible on hundreds of repos. We also do not want to host the binary publicly.
If you have been in a similar situation, please let me know on how you resolved it.
because adding a personal access token is not feasible on hundreds of repos
That means using one key (a deploy key, associated to the unique repository with the binary, instead of a PAT associated to a user) in order to access said binary.
Using gh secret set, you can add that key to hundred of repository through a script.
Then a common GitHub action can reference that secret when executed in each repository.

What's the best way to modularise reusable functionality across Flutter apps?

TLDR: When following clean architecture, when should a reusable piece of functionality be reused across different apps via a module vs a template, and how does one decide on the interface of a module?
Background
I'm currently writing some packages (for personal use when freelancing) for common functionality that can be reused across multiple Flutter apps and wondering what's a good way to organise them. With my apps I follow the clean architecture guidelines, splitting an app by features, with each feature consisting of data, domain and presentation layers:
|--> lib/
|
|--> feature_a/
| |
| |--> data/
| | |
| | |--> data_sources/
| | |
| | |--> repository_implementations/
| | |
| |--> domain/
| | |
| | |--> repository_contracts/
| | |
| | |--> entities/
| | |
| | |--> use_cases/
| | |
| |--> presentation/
| | |
| | |--> blocs/
| | |
| | |--> screens/
| | |
| | |--> widgets/
| | |
|--> feature_b
| |
| |--> ...
Example
If we take the user authentication feature, for example, I know that:
The entire domain layer, as well as the bloc, will be the same across most apps (email and password validation, authentication/login blocs, etc.)
The data layer will change depending on the backend/database (different providers = different calls)
The screens/widgets will change with different UI's (different apps will have different login and onboarding pages)
Current Approach
My thinking is to write something like a single backend-agnostic "core_auth_kit" package, which contains the domain and bloc, and one package for each backend service I might use, e.g. "firebase_auth_kit", "mongodb_auth_kit", etc. Each backend-specific package will use the "core_auth_kit" as the outward-facing interface.
Here's how I plan on using this. If I'm writing a simple Firebase Flutter app, I will simply import the "firebase_auth_kit" package, and instantiate its auth_bloc at the root of the app inside a MultiBlocProvider, showing the login page if the state is "unauthenticated" and the home page if it's "authenticated".
Questions
What is the standard practice for deciding on the boundary of a module? i.e. is this approach of using the "highest common layer" (bloc in the authentication example) the way to go?
When should a reusable piece of functionality be extracted as a template vs a module (is my example a good candidate for a module, or should it be a template instead)?

Service Loader config file doesn't explode properly

So I am writing a webapp in Eclipse and I want to use the serviceloader in one of my classes. Question is where to put the META-INF/services stuff. From here (https://stackoverflow.com/a/3421191/2742995) I found:
But the ideal way is to have it in your plugin's jar file. E.g if you
have a plugin bundled as WEB-INF/lib/myplugin.jar, and your plugin
class is com.example.plugin.MyPlugin Then the jar should have a
structure:
myplugin.jar!/META-INF/services/com.example.plugin.MyPlugin
So I have in the module containing the serviceloader stuff, the source: src/main/java/ containing
vcs.validation.* (containing the source code)
a folder: META-INF/services/vcs.validation.javatests.JavaTest containing:
Test1 (which reads vcs.validation.javatests.Test1) and
Test2 (which reads vcs.validation.javatests.Test2)
(The interface vcs.validation.javatests.JavaTest has two implementing classes Test1 and Test2)
However, when I package the whole webapp as a war and deploy in tomcat the web-app/WEB-INF/classes/ folder does not contain any META-INF/services/. What am I doing wrong here?
Structure should be:
Project
| Module
| | src
| | main
| | java
| | [ source code]
| | resources
| | META-INF
| | services
| | [service files]
instead of:
Project
| Module
| | src
| | main
| | java
| | [source code]
| | META-INF
| | services
| | [service files]
In this way the service files are no longer exploded to webapp/WEB-INF/classes/META-INF/services but just live in the jar in which they are packaged according to:
myplugin.jar!/META-INF/services/com.example.plugin.MyPlugin

Hidden folder in Jasper repository

On creating a report via iReports, called "Test", iReports will create a hidden folder in the repo called "Test_files".
You can see these folders through the database in the table jiresourcefolder, because it has a column called hidden.
id | version | uri | hidden | name | label | description | parent_folder | ...
You cannot access the folders through the default GUI, nor through anything else but the database and the webservice, if you explicitly request the ResourceDescriptor of the folder.
Now my question: Is there any option or property (inside the resource descriptor) that can bet set to hide or unhide a folder or even other resources?

Best Practices for Project Feature Sub-Modules with Mercurial and Eclipse?

I have a couple of ANT projects for several different clients; the directory structure I have for my projects looks like this:
L___standard_workspace
L___.hg
L___validation_commons-sub-proj <- JS Library/Module
| L___java
| | L___jar
| L___old_stuff
| L___src
| | L___css
| | L___js
| | L___validation_commons
| L___src-test
| L___js
L___v_file_attachment-sub-proj <- JS Library/Module
| L___java
| | L___jar
| L___src
| | L___css
| | L___js
| L___src-test
| L___js
L___z_business_logic-sub-proj <- JS Library/Module
| L___java
| | L___jar
| L___src
| L___css
| L___js
L____master-proj <- Master web-deployment module where js libraries are compiled to.
L___docs
L___java
| L___jar
| L___src
| L___AntTasks
| L___build
| | L___classes
| | L___com
| | L___company
| L___dist
| L___nbproject
| | L___private
| L___src
| L___com
| L___company
L___remoteConfig
L___src
| L___css
| | L___blueprint
| | | L___plugins
| | | | L___buttons
| | | | | L___icons
| | | | L___fancy-type
| | | | L___link-icons
| | | | | L___icons
| | | | L___rtl
| | | L___src
| | L___jsmvc
| L___img
| | L___background-shadows
| | L___banners
| | L___menu
| L___js
| | L___approve
| | L___cart
| | L___confirm
| | L___history
| | L___jsmvc
| | L___mixed
| | L___office
| L___stylesheets
| L___swf
L___src-standard
Within the working copy the modules compile the sub-project into a single Javascript file that is placed in the Javascript directory of the master project.
For example, the directories:
validation_commons-sub-proj
v_file_attachment-sub-proj
z_business_logic-sub-proj
...all are combined and minified (sort of like compiled) into a different Javascript filename in the _master-proj/js directory; and in the final step the _master-proj is compiled to be deployed to the server.
Now in regards to the way I'd like to set this up with hg, what I'd like to be able to do is clone the master project and its sub-projects from their own base-line repositories into a client's working-copy, so that modules can be added (using hg) to a particular customer's working copy.
Additionally however, when I do make some changes to/fix bugs in one customer's working copy, I would like to be able to optionally push the changes/bug fixes back to the master project/sub-project's base-line repository, for purposes of eventually pulling the changes/fixes into other customer's working copies that might contain the same bugs that need to be fixed.
In this way I will be able to utilize the same bug fixes across different clients.
However...I am uncertain of the best way to do this using hg and Eclipse.
I read here that you can use hg's Convert Extension to split a sub-directory into a separate project using the --filemap option.
However, I'm still a little bit confused as to if it would be better to use the Convert Extension or if it would be better to just house each of the modules in their own repository and check them out into a single workspace for each client.
Yep, it looks like subrepos are what you are looking for, but I think maybe that is the right answer for the wrong question and I strongly suspect that you'll run into similar issues that occur when using svn:externals
Instead I would recommend that you "publish" your combined and minified JS files to an artefact repository and use a dependency manager such as Ivy to pull specific versions of your artefacts into your master project. This approach give you far greater control over the sub-project versions your master project uses.
If you need to make bug fixes to a sub-project for a particular client, you can just make the fixes on the mainline for that sub-project, publish a new version (ideally via an automated build pipeline) and update their master project to use the new version. Oh, you wanted to test the new version with the their master project before publishing? In that case, before you push your fix, combine and minify your sub-project locally, publish it to a local repository and have the client's master project pick up that version for your testing.