Giter Club home page Giter Club logo

Comments (2)

dosubot avatar dosubot commented on August 16, 2024 3

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.

from incubator-devlake.

d4x1 avatar d4x1 commented on August 16, 2024

@jluque0101 You can set up two connections with different scope-configs to circumvent this issues.

from incubator-devlake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.