[Question][GitHub] GitOps-like repos belonging to multiple projects.
Question
I have a question regarding projects and shared repositories.
Use Case: I have two teams, Team A and Team B. Each team has its own repository, and they share a GitOps-like repository where they publish new releases for deployment. The shared repository uses GitHub Actions (with different names depending on which files were updated) to track deployments. However, the regex used in scope-config should be different for each project because the action name to be tracked as a deployment is different for each team.
Question: Is there a way to associate multiple scope-configs for a repository depending on which project it is associated with? Alternatively, what is the best approach to handle this use case ?
Hello, @jluque0101! I'm here to assist you with any questions, bugs, or issues you may have. I can help you solve problems, answer questions, and even guide you on how to become a contributor. Let me know how I can assist you today!
Yes, there is a way to associate multiple scope-configs for a repository depending on which project it is associated with. The application supports associating and updating scope configurations for different projects. The handleAssociateScopeConfig and handleUpdate functions demonstrate how scope configurations can be managed and applied to different projects.
Here is a relevant code snippet that handles the association and updating of scope configurations:
const handleAssociateScopeConfig = async (trId: ID) => {
const [success] = await operator(
() =>
Promise.all(
scopeIds.map(async (scopeId) => {
const scope = await API.scope.get(plugin, connectionId, scopeId);
return API.scope.update(plugin, connectionId, scopeId, {
...scope,
scopeConfigId: trId !== 'None' ? +trId : null,
});
}),
),
{
setOperating,
formatMessage: () =>
trId !== 'None' ? 'Associate scope config successful.' : 'Dis-associate scope config successful.',
},
);
if (success) {
handleHideDialog();
setVersion(version + 1);
message.success(
'Scope Config(s) have been updated. If you would like to re-transform or re-collect the data in the related project(s), please go to the Project page and do so.',
);
}
};
const handleUpdate = async (trId: ID) => {
handleHideDialog();
const [success, res] = await operator(() => API.scopeConfig.check(plugin, trId), { hideToast: true });
if (success) {
handleShowProjectsModal(res.projects ?? []);
}
};
Additionally, the ScopeConfigForm component provides a user interface for creating and updating scope configurations. This form allows users to specify the name, data entities, and transformations for a scope configuration, which can then be associated with different projects.
For more detailed information, you can refer to the relevant files in the repository:
config-ui/src/plugins/components/scope-config/index.tsx[1]config-ui/src/routes/connection/connection.tsx[2]config-ui/src/plugins/components/scope-config-form/index.tsx[3]
This approach ensures that the correct scope configurations are applied based on the project context, allowing you to handle different regex patterns for tracking deployments in GitHub Actions workflows for each team.
To continue talking to Dosu, mention @dosu.
@jluque0101 You can set up two connections with different scope-configs to circumvent this issues.
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.
i have also ran into this, @jluque0101, did you end up solving this ?
@KyriosGN0 not really, setting up 2 connections as @d4x1 suggested would imply that data is duplicated if I understand correctly.
This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.
This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.