Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokenize.ps1 fails to selectsinglenode without namespace #46

Closed
johndpalm opened this issue Jul 7, 2016 · 12 comments · Fixed by #54
Closed

tokenize.ps1 fails to selectsinglenode without namespace #46

johndpalm opened this issue Jul 7, 2016 · 12 comments · Fixed by #54

Comments

@johndpalm
Copy link

I'm trying to use the Tokenizer against a SharePoint app manifest.xml file. SelectSingleNode (line 57) fails since there is a name space. I think if you test for NameTable or NamespaceURI you can support this with little code change:

$ns = New-Object System.Xml.XmlNamespaceManager($xmlraw.NameTable)
$ns.AddNamespace("ns", $xmlraw.DocumentElement.NamespaceURI)
$xmlraw.SelectSingleNode("//ns:$($key.KeyName)", $ns)

@pascalberger
Copy link
Contributor

@johndpalm Depending on what you need to patch in the SharePoint app manifest, we have created a build task which allows to set the URL & ClientID in the app manifest. You can find the extension here.

@incarnate
Copy link
Contributor

Just to note we've experienced the same issue when trying to do a replace with NLog configurations in Web.config as it is namespaced.

Happy to submit a fix along the lines of John's suggestion above, however I wasn't sure on how the move to the new Powershell/VSTS SDK has progressed (#29)

@pascalberger
Copy link
Contributor

@incarnate There exists a branch which I assume is related to #29: https://github.com/openalm/Extension-UtilitiesPack/commits/features/vsts-new-sdk-port.

But unfortunately there was no interaction here in any branch, PR or issue from any member / MSFT employee in the past 2 months...

@incarnate
Copy link
Contributor

I'd noted the same @pascalberger :-(

Paging @harshil93 - is this extension still being updated or maintained?

@incarnate
Copy link
Contributor

incarnate commented Aug 4, 2016

I've got a fix for this ready, just waiting on #50 to be merged.

I've added an option for two extra parameters to the JSON file so that the namespace can be set, like so:

  {
    "KeyName": "/configuration/ns:nlog/ns:targets/ns:target[@name='email']",
    "Attribute": "to",
    "value": "logs@test.com",
    "NamespaceUrl": "http://www.nlog-project.org/schemas/NLog.xsd",
    "NamespacePrefix": "ns"
  }

@harshil93
Copy link
Member

@incarnate I have updated the extension to use the latest sdk and it now supports secret vars too. I won't put it on marketplace because of some compat reasons. You can pull in the source code and package it under your own private publisher name and install it. It will require the new coreclr agent with version >= 2.104.2 to work.

@pascalberger
Copy link
Contributor

@harshil93 Does this mean version on the marketplace never will be updated?

@incarnate
Copy link
Contributor

Thanks for the update @harshil93 - I should have time to submit a PR for this later in the week.

I echo Pascal's question on if/when this will be one the marketplace, I thought bumping the major version number would protect the existing installs & configurations.

@harshil93
Copy link
Member

@incarnate @pascalberger The problem with updating it on the market place is that, it has a dependency on the new agent. Some of the Hosted Agents are still on the old agent. They should be updated to the new agent in a couple of weeks and after that I will release it to the market place.

I will try the logic of bumping major version, but I don't think its gonna work. At max it would be a couple of weeks of waiting.

Sounds good ??

@incarnate
Copy link
Contributor

Sounds good to me, I didn't realise the limitation was the hosted agents. Since we're using hosted agents I'll hold off on deploying this as well.

incarnate added a commit to incarnate/Extension-UtilitiesPack that referenced this issue Sep 5, 2016
Adds two additional configuration variables `NamespaceUrl` and
`NamespacePrefix` to specify when a namespace is used in the targeted XML
Keyname.

Resolves openalm#46
incarnate added a commit to incarnate/Extension-UtilitiesPack that referenced this issue Sep 5, 2016
Adds two additional configuration variables `NamespaceUrl` and
`NamespacePrefix` to specify when a namespace is used in the targeted XML
Keyname.

Resolves openalm#46
@harshil93
Copy link
Member

@incarnate Closing this. You can go ahead and fix this issue as the new sdk port is done.

@incarnate
Copy link
Contributor

Thanks @harshil93 - please see PR #54 for this fix

harshil93 pushed a commit that referenced this issue Oct 21, 2016
Adds two additional configuration variables `NamespaceUrl` and
`NamespacePrefix` to specify when a namespace is used in the targeted XML
Keyname.

Resolves #46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants