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

Install and use licenses in standard file locations #741

Merged
merged 1 commit into from
Aug 24, 2017

Conversation

timbussmann
Copy link
Contributor

@timbussmann timbussmann commented Aug 15, 2017

ServiceInsight will now install licenses in the following location:

  • %localappdata%\ParticularSoftware\license.xml

...and it will use licenses located in any of the following locations:

  • {Application base directory\license.xml} (e.g. C:\MyApps\MyEndpoint\license.xml)
  • %programdata%\ParticularSoftware\license.xml
  • %localappdata%\ParticularSoftware\license.xml

@adamralph adamralph self-requested a review August 15, 2017 12:46
@timbussmann timbussmann changed the title [WIP] Update licensing Update licensing Aug 17, 2017
@timbussmann
Copy link
Contributor Author

this is ready for review. Please note this is only a suggestion how to deal with the changes to the new license locations. Quickly tested the behavior locally.

@adamralph adamralph requested review from a team and adamralph and removed request for adamralph August 17, 2017 11:31
Copy link
Contributor

@adamralph adamralph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the suppressions, the changes LGTM.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1128:ConstructorInitializerMustBeOnOwnLine", Justification = "Generated File.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1516:ElementsMustBeSeparatedByBlankLine", Justification = "Generated File.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.Naming Rules", "SA1303:ConstFieldNamesMustBeginWithUpperCaseLetter", Justification = "Generated File.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines have been added to suppress the StyleCop violations found in the source files added by the new licensing package.

We should not be doing this here because this will suppress those rules for all files.

I'm not sure if StyleCop.Analyzers has a way to suppress specific files from analysis (the best I could find was this issue which I commented on way back), but I have raised https://github.com/Particular/Operations.Licensing/pull/37 to fix these violations in the source package, so if that PR is merged then we can update to the latest package and remove these lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI https://github.com/Particular/Operations.Licensing/pull/37 has been merged.

@Particular/operations-licensing-maintainers please let us know when a new alpha has been released so we can update to it in this PR.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1516:ElementsMustBeSeparatedByBlankLine", Justification = "Generated File.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.Naming Rules", "SA1303:ConstFieldNamesMustBeginWithUpperCaseLetter", Justification = "Generated File.")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Code", "PCR0001:Await used without specifying ConfigureAwait", Justification = "Default in WPF is fine.")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a repitition of a line above and should be removed.

@@ -41,7 +41,7 @@ public License()

public bool ValidForApplication(string applicationName)
{
return ValidApplications.Contains(applicationName) || ValidApplications.Contains("All");
return ValidApplications.Contains(applicationName) || ValidApplications.Contains("All") || applicationName == "NServiceBus";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need "NServiceBus" for the app name here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added to accommodate for older licenses so I think we can just leave as is unless its causing issues for SI?

See:

https://github.com/Particular/Operations.Licensing/pull/28

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in @Particular/serviceinsight-maintainers sync today. We're OK with this. It doesn't affect SI.

@andreasohlund
Copy link
Member

andreasohlund commented Aug 22, 2017 via email

@timbussmann
Copy link
Contributor Author

updated to alpha7

Copy link
Contributor

@adamralph adamralph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @timbussmann, the changes look good to me.

Can you please:

  • Entirely revert the changes to GlobalSuppressions.cs. There's still an EOL change in there which causes the file to be shown in the diff.
  • Squash all the commits into one

Then I'll be happy to approve/merge.

@timbussmann
Copy link
Contributor Author

@adamralph reverted changes to the globalsuppressions.cs. Can't you squash yourself when merging using github's squash & merge feature?

@adamralph
Copy link
Contributor

Thanks @timbussmann.

Can't you squash yourself when merging using github's squash & merge feature?

We never use that, since it does an ff merge and looks like a push straight to master in the history. I'd use it if it had a no-ff option.

I've squash locally and force pushed.

Copy link
Contributor

@adamralph adamralph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Particular/serviceinsight-maintainers I've squashed @timbussmann's commits. If you're happy with the result can you please merge.

@WilliamBZA WilliamBZA merged commit 249c565 into master Aug 24, 2017
@WilliamBZA WilliamBZA deleted the update-licensing branch August 24, 2017 06:32
@adamralph adamralph added this to the 1.7.3 milestone Aug 24, 2017
@adamralph
Copy link
Contributor

@timbussmann is there any functional change for the user here? Does this mean SI now respects new locations for license files?

@timbussmann
Copy link
Contributor Author

@adamralph yes, SI would now search the new file locations for licenses and would also install new licenses to the new storage location (to the user local app data) additionally to the registry.

@adamralph adamralph changed the title Update licensing Read and store licenses in standard file locations Aug 25, 2017
@adamralph adamralph changed the title Read and store licenses in standard file locations Use and install licenses in standard file locations Aug 25, 2017
@adamralph
Copy link
Contributor

Thanks @timbussmann, I've updated the title and description, and marked this as a feature. Can you please check to see if the title and description are correct?

@Particular/serviceinsight-maintainers given this is a feature, I've changed the next milestone from 1.7.2 to 1.8.0.

@adamralph adamralph changed the title Use and install licenses in standard file locations Install and use licenses in standard file locations Aug 25, 2017
@timbussmann
Copy link
Contributor Author

@adamralph LGTM except that the file paths are alawys using particularsoftware, nut just particular (also, they are lowercase)

@adamralph
Copy link
Contributor

@timbussmann

the file paths are alawys using particularsoftware, nut just particular

👍 thanks, corrected.

also, they are lowercase

I see PascalCase here:

public static readonly string UserLevelLicenseLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ParticularSoftware", "license.xml");

@timbussmann
Copy link
Contributor Author

@adamralph ah you're right. Sorry it was just the file name applied the lowercasing rule. Wondering whether that should be changed for the rest of the path as well now :/

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

Successfully merging this pull request may close these issues.

5 participants