Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
coenm committed Sep 9, 2024
1 parent bac0ee4 commit 4c9c0cb
Show file tree
Hide file tree
Showing 26 changed files with 199 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

The AzureDevops module enables integration with one azure devops environment. The integration currently focuses on Pull Requests.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.AzureDevOps
- PluginName: AzureDevOps
- PluginDescription: Integration with Azure Devops providing fetching and creating pull requests.
- PluginMarkdownDescription: The AzureDevops module enables integration with one azure devops environment. The integration currently focuses on Pull Requests.

## Configuration

The configuration. TODO

This module contains the following methods, variables and/or constants:

## azure-devops-create-pr@1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

This module provides a repository actions to copy specific (evaluated) text to the clipboard using the action provider type `clipboard-copy`.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.Clipboard
- PluginName: Clipboard
- PluginDescription: Provides a 'copy to clipboard' action.
- PluginMarkdownDescription: This module provides a repository actions to copy specific (evaluated) text to the clipboard using the action provider type `clipboard-copy`.

## Configuration

This plugin has no configuration.

This module contains the following methods, variables and/or constants:

## clipboard-copy@1
Expand Down
6 changes: 5 additions & 1 deletion docs/mdsource/plugin_repom.plugin.heidi.generated.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

This module integrates with a portable [HeidiSQL](https://www.heidisql.com/) installation. The portable Heidi DB saves its database configuration in a portable configuration file. This module monitors this file and makes it possible to use this configuration in the action menu.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.Heidi
- PluginName: HeidiSQL
- PluginDescription: Contains context variables to be used in the action menu. The variables are extracted from the portable Heidi DB configuration.
- PluginMarkdownDescription: This module integrates with a portable [HeidiSQL](https://www.heidisql.com/) installation. The portable Heidi DB saves its database configuration in a portable configuration file. This module monitors this file and makes it possible to use this configuration in the action menu.

## Configuration

The configuration. TODO

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

Contains a custom query parser based on Lucene syntax for repository filtering.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.LuceneQueryParser
- PluginName: LuceneQueryParser
- PluginDescription: Contains a custom query parser based on Lucene syntax for repository filtering.
- PluginMarkdownDescription: \<empty\>

## Configuration

This plugin has no configuration.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

This module integrates with SonarCloud. Currently, the only functionality is to star a given repository in SonarCloud using the repository action.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.SonarCloud
- PluginName: SonarCloud
- PluginDescription: Providing a repository action to mark a repository as favorite in SonarCloud
- PluginMarkdownDescription: This module integrates with SonarCloud. Currently, the only functionality is to star a given repository in SonarCloud using the repository action.

## Configuration

The configuration. TODO

This module contains the following methods, variables and/or constants:

## sonarcloud-set-favorite@1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

Provides functionality to keep track how may times an action is performed on a given repository. These numbers can be accessed using variable providers. The plugin also contains functionality to use these statistics in orderings.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.Statistics
- PluginName: Statistics
- PluginDescription: Provides functionality to keep track how may times an action is performed on a given repository. These numbers can be accessed using variable providers. The plugin also contains functionality to use these statistics in orderings.
- PluginMarkdownDescription: \<empty\>

## Configuration

The configuration. TODO

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

Provides functionality to start a web browser from an action with profile information.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.WebBrowser
- PluginName: WebBrowser
- PluginDescription: Provides functionality to start a web browser from an action with profile information.
- PluginMarkdownDescription: \<empty\>

## Configuration

The configuration. TODO

This module contains the following methods, variables and/or constants:

## browser@1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

As an extra goodie for Windows users, RepoM automatically detects open File Explorer windows and adds a status appendix to their title if they are in context of a git repository.

To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: RepoM.Plugin.WindowsExplorerGitInfo
- PluginName: WindowsExplorerTitle
- PluginDescription: Contains a hook updating Explorer views in Windows with the current git status.
- PluginMarkdownDescription: As an extra goodie for Windows users, RepoM automatically detects open File Explorer windows and adds a status appendix to their title if they are in context of a git repository.

## Configuration

This plugin has no configuration.

4 changes: 4 additions & 0 deletions docs/mdsource/repom.generated.source.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# RepoM Core Repository Actions

## Configuration

This plugin has no configuration.

This module contains the following methods, variables and/or constants:

## browse-repository@1
Expand Down
16 changes: 16 additions & 0 deletions src/RepoM.ActionMenu.CodeGen/Models/ActionMenuClassDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ public class ActionMenuClassDescriptor : ClassDescriptor

public string RepositoryActionName => Name;

public override void Accept(IClassDescriptorVisitor visitor)
{
visitor.Visit(this);
}
}

[DebuggerDisplay($"{{{nameof(ClassName)},nq}}")]
public class ModuleConfigurationClassDescriptor : ClassDescriptor
{
/// <summary>
/// Properties
/// </summary>
//public List<ActionMenuMemberDescriptor> ActionMenuProperties { get; } = [];

public bool IsObsolete { get; set; }

public override void Accept(IClassDescriptorVisitor visitor)
{
visitor.Visit(this);
Expand Down
12 changes: 11 additions & 1 deletion src/RepoM.ActionMenu.CodeGen/Models/ProjectDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public sealed class ProjectDescriptor
/// The directory of the project.
/// </summary>
public required string Directory { get; init; }

/// <summary>
/// List of class descriptors for configuration classes
/// </summary>
public List<ModuleConfigurationClassDescriptor> ConfigurationClasses { get; } = [];

/// <summary>
/// List of class descriptors for repository actions.
Expand Down Expand Up @@ -62,7 +67,12 @@ public sealed class ProjectDescriptor
/// is plugin or not.
/// </summary>
public bool IsPlugin { get; private set; }


/// <summary>
/// When the project is a plugin, it might have some configuration.
/// </summary>
public bool HasConfiguration => ConfigurationClasses.Count > 0;

[ScriptMemberIgnore]
public void SetPackageInformation(PackageAttribute attribute)
{
Expand Down
23 changes: 23 additions & 0 deletions src/RepoM.ActionMenu.CodeGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ private static Dictionary<string, List<MemberDescriptor>> GetAllMembersFromProje
allMemberTypes[classDescriptor.FullName].AddRange(classDescriptor.Members);
}

foreach (ModuleConfigurationClassDescriptor classDescriptor in project.ConfigurationClasses)
{
allMemberTypes.TryAdd(classDescriptor.FullName, []);
allMemberTypes[classDescriptor.FullName].AddRange(classDescriptor.Members);
}

foreach (ModuleConfigurationClassDescriptor classDescriptor in project.ConfigurationClasses)
{
allMemberTypes.TryAdd(classDescriptor.FullName, []);
allMemberTypes[classDescriptor.FullName].AddRange(classDescriptor.Members);
}

foreach (ClassDescriptor classDescriptor in project.Types)
{
allMemberTypes.TryAdd(classDescriptor.FullName, []);
Expand Down Expand Up @@ -248,6 +260,7 @@ private static void ProcessProject(Compilation compilation, ProjectDescriptor pr
AttributeData? obsoleteAttribute = typeSymbol.FindAttribute<ObsoleteAttribute>();
AttributeData? actionMenuContextAttribute = typeSymbol.FindAttribute<ActionMenuContextAttribute>();
AttributeData? repositoryActionAttribute = typeSymbol.FindAttribute<RepositoryActionAttribute>();
AttributeData? moduleConfigurationAttribute = typeSymbol.FindAttribute<ModuleConfigurationAttribute>();

if (actionMenuContextAttribute != null && obsoleteAttribute == null)
{
Expand All @@ -270,6 +283,16 @@ private static void ProcessProject(Compilation compilation, ProjectDescriptor pr

classDescriptor = actionMenuClassDescriptor;
}
else if (moduleConfigurationAttribute != null)
{
var actionMenuClassDescriptor = new ModuleConfigurationClassDescriptor
{
IsObsolete = false,
};
projectDescriptor.ConfigurationClasses.Add(actionMenuClassDescriptor);

classDescriptor = actionMenuClassDescriptor;
}
else
{
classDescriptor = new ClassDescriptor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ end
{{~ end ~}}

{{~ ## include: _plugin_enable ## ~}}
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. When enabling or disabling a plugin, you should restart RepoM.
To use this module, make sure it is enabled in RepoM by opening the menu and navigate to 'Plugins'. After enabling or disabling a plugin, you should restart RepoM.

- ProjectName: {{ write_default_when_null plugin.ProjectName }}
- PluginName: {{ write_default_when_null plugin.PluginName }}
Expand All @@ -42,6 +42,13 @@ To use this module, make sure it is enabled in RepoM by opening the menu and nav
# {{ plugin.IsPlugin ? plugin.PluginName : "RepoM Core Repository Actions" }}
{{~ end ~}}

## Configuration
{{~ if plugin.HasConfiguration }}
The configuration. TODO
{{ else }}
This plugin has no configuration.
{{~ end ~}}

{{~ if array.size(plugin.ActionMenus) > 0 ~}}
This module contains the following methods, variables and/or constants:
{{~ for member in plugin.ActionMenus ~}}
Expand Down
30 changes: 30 additions & 0 deletions src/RepoM.Core.Plugin/AssemblyInformation/PackageAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,33 @@ public PackageAttribute(string name, string toolTip, string description)

public string Description { get; }
}


/// <summary>
/// This attribute is optional for Plugins.
/// RepoM uses this attribute to extract module configuration objects for documentation purposes.
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public sealed class ModuleConfigurationAttribute : Attribute
{
public string DefaultValueFactoryMethod { get; }

public ModuleConfigurationAttribute(string defaultValueFactoryMethod)
{
DefaultValueFactoryMethod = defaultValueFactoryMethod;
}

public ModuleConfigurationAttribute()

Check warning on line 41 in src/RepoM.Core.Plugin/AssemblyInformation/PackageAttribute.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Non-nullable property 'DefaultValueFactoryMethod' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

Check warning on line 41 in src/RepoM.Core.Plugin/AssemblyInformation/PackageAttribute.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Non-nullable property 'DefaultValueFactoryMethod' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{

}
}

[AttributeUsage(AttributeTargets.Method)]
public sealed class ModuleConfigurationDefaultValueFactoryMethodAttribute : Attribute
{
public ModuleConfigurationDefaultValueFactoryMethodAttribute()
{

}
}
4 changes: 2 additions & 2 deletions src/RepoM.Plugin.AzureDevOps/AzureDevOpsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static async Task ExtractAndRegisterConfiguration(Container container, I

config ??= await PersistDefaultConfigAsync(packageConfiguration).ConfigureAwait(false);

container.RegisterInstance<IAzureDevopsConfiguration>(new AzureDevopsConfiguration(config.BaseUrl, config.PersonalAccessToken));
container.RegisterInstance<IAzureDevopsConfiguration>(new AzureDevopsConfiguration(config.BaseUrl, config.PersonalAccessToken2));
}

private static void RegisterServices(Container container)
Expand All @@ -59,7 +59,7 @@ private static void RegisterServices(Container container)
/// <remarks>This method is used by reflection to generate documentation file</remarks>
private static async Task<AzureDevopsConfigV1> PersistDefaultConfigAsync(IPackageConfiguration packageConfiguration)
{
var config = new AzureDevopsConfigV1();
var config = AzureDevopsConfigV1.CreateDefault();
await packageConfiguration.PersistConfigurationAsync(config, CurrentConfigVersion.VERSION).ConfigureAwait(false);
return config;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
namespace RepoM.Plugin.AzureDevOps.PersistentConfiguration;

using RepoM.Core.Plugin.AssemblyInformation;

/// <remarks>DO NOT CHANGE PROPERTYNAMES, TYPES, or VISIBILITIES</remarks>
/// <summary>Module configuration (version 1)</summary>
[ModuleConfiguration]
public class AzureDevopsConfigV1
{
/// <summary>
/// Personal access token (PAT) to access Azure Devops. The PAT should be granted access to read pull requests.
/// Personal access token (PAT) to access Azure Devops. The PAT should be granted access to read and write pull requests.
/// To create a PAT, goto `https://dev.azure.com/[my-organisation]/_usersSettings/tokens`.
/// </summary>
public string? PersonalAccessToken { get; init; }
public string? PersonalAccessToken2 { get; init; }

/// <summary>
/// The base url of azure devops for your organisation (i.e. `https://dev.azure.com/[my-organisation]/`).
/// </summary>
public string? BaseUrl { get; init; }

[ModuleConfigurationDefaultValueFactoryMethod]
internal static AzureDevopsConfigV1 CreateDefault()
{
return new AzureDevopsConfigV1();
}
}
2 changes: 1 addition & 1 deletion src/RepoM.Plugin.Heidi/HeidiPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static void RegisterInternals(Container container)
/// <remarks>This method is used by reflection to generate documentation file</remarks>
private static async Task<HeidiConfigV1> PersistDefaultConfigAsync(IPackageConfiguration packageConfiguration)
{
var config = new HeidiConfigV1();
var config = HeidiConfigV1.CreateDefault();
await packageConfiguration.PersistConfigurationAsync(config, CurrentConfigVersion.VERSION).ConfigureAwait(false);
return config;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace RepoM.Plugin.Heidi.PersistentConfiguration;

using RepoM.Core.Plugin.AssemblyInformation;

/// <remarks>DO NOT CHANGE PROPERTYNAMES, TYPES, or VISIBILITIES</remarks>
/// <summary>Module configuration (version 1)</summary>
[ModuleConfiguration]
public class HeidiConfigV1
{
/// <summary>
Expand All @@ -18,4 +21,10 @@ public class HeidiConfigV1
/// The full executable of Heidi.
/// </summary>
public string? ExecutableFilename { get; init;}

[ModuleConfigurationDefaultValueFactoryMethod]
internal static HeidiConfigV1 CreateDefault()
{
return new HeidiConfigV1();
}
}
Loading

0 comments on commit 4c9c0cb

Please sign in to comment.