question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplication of custom operations

See original GitHub issue

First of all, neither CustomOperations nor SpecialCustomOperations are included in the json schema, which results in no Intellisense support in VS 2017, and makes them hard to work with.

We need to use conditional processing for XML content in various template files, but, while it works fine for our *proj files, it does not work for .config files out of the box. We had to add special operations for .config files to enable it as follows.

  "SpecialCustomOperations": {
    "**/*.config": {
      "operations": [
        {
          "type": "conditional",
          "configuration": {
            "actionableIf": [ "<!--#if" ],
            "actionableElse": [ "#else", "<!--#else" ],
            "actionableElseif": [ "#elseif", "<!--#elseif", "#elif", "<!--#elif" ],
            "endif": [ "#endif", "<!--#endif" ],
            "trim": "true",
            "wholeLine": "true",
            "actions": [ "fixPseudoNestedComments" ]
          }
        },
        {
          "type": "balancednesting",
          "configuration": {
            "startToken": "<!--",
            "realEndToken": "-->",
            "pseudoEndToken": "-- >",
            "id": "fixPseudoNestedComments",
            "resetFlag": "_TestResetFlag_"
          }
        }
      ]
    },...

However, we also have other files that contain XML with a different extension (*.xom). So, to enable conditional processing for those as well, we had to repeat the same configuration for the **/*.xom pattern, since I don’t know how to specify the glob to cover multiple extensions. This results in unnecessary duplication, and bloats the template configuration.

It would be great if the operations could be defined separately under a unique name, and then just referenced by the special custom operations under the respective globs. In this case we would just reference the standard operation to apply it to any additional extensions. Please let me know if there is a better way to define such conditional processing without duplicating configurations.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vlada-shubinacommented, May 16, 2023

As a possible solution, we discussed having shorter syntax for it as:

  "SpecialCustomOperations": {
      "inheritsFrom": {
               "**/*.config" : "**/*.xml",
               ...
      }
    },...

where key value pairs are:

  • glob pattern that should inherit the configuration from existing
  • glob pattern to use (should exist either in standard configs or given in template.json)
0reactions
XomegaNetcommented, May 19, 2023

@vlada-shubina I guess this approach should work. Thanks for looking into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Copying Custom Operations
You create duplicates of existing custom operations to make minor changes. Procedure. Choose Start of the navigation path Automation Studio Next navigation step ......
Read more >
Copying Custom Operations
In the Actions column of the custom operation you want to copy, choose Copy Selected Custom Operation. Optional: Adapt the name for the...
Read more >
De-duplication on custom objects
I have a custom object where i have a lot of duplicates. Is there a way to automatically identify and deduplicate them? like...
Read more >
Customize Duplicate Rules
Customize Duplicate Rules. Manage duplicates more effectively by adjusting the settings in standard duplicate rules or creating custom rules.
Read more >
Have you duplicated payments through the Customs ...
Have you duplicated payments through the Customs Declarations System? HMRC believes that some importers may have submitted duplicate ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found