Skip to content

Commit 2daa197

Browse files
janstaelensskylineMichielOdaMariekeGO
authored
Introduction of Skyline.DataMiner.Sdk project templates (SkylineCommunications#25)
* WIP * Added automation library project, automation project, adhocdata project and packageproject. * Updated to use provided project name as input. * Removing Ad Hoc Data Source & User-Defined API solutions. Added User-Defined API Project instead. Removed Internal folders from the projects as they will be handled by DIS. Renamed folders * Change to new syntax for the Skyline.DataMiner.Sdk * Change package project to have a single 'PackageContent' folder instead of it being split up * Specify version as that is needed * Prepare for demo * Missing 1 * Removed Dlls folder as it isn't needed anymore + changes for package support * Small tweaks * Add Dashboards folder * Adding Catalog Stuff * Readme Image fix * Added support for Catalog Publish. TODO: update SDK to released version. * Remove .vs folder + adapt templates to use checkbox for catalog information * Exclude .vs folders * Use 'official' pre-release version of SDK * Add SecureCoding Analyzers to project templates * Reduce size of wip image. * Optional AddGitHubWorkflow variable. Added Detection If addition will creation a Solution * Got the discrete to work. But WIP * Work in Progress Added Shared Items Added Basic-Complete selections Added checkbox for package creation * Add not supported to CatalogReferences * Remove conditions for connector solution for Directory.Build.props file * Cleanup, added default values, added GettingStarted.md guides. * Formatting of json files. Small tweaks and fixes * Add dependabot file for the templates * Fix package-project not generating the CatalogInformation stuff * Align DevPack version * * global.json added * reworked conditional for on Solution Level files * Improved IDE text. Fixed showing the GettingStarted in TemplatePack * Fix if condition in csproj files Also updated AppPackageInstaller to latest version * Tweaking getting started * Update working/templates/gqi-ad-hoc-data-source-project/.template_config/template.json Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> * Feedback from user for Getting Started * Update working/templates/user-defined-api-project/$SCRIPTNAME$.cs Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> * Cleanup and changes * Update working/templates/package-project/PackageContent/CompanionFiles/Skyline DataMiner/AboutThisFolder.md Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> * More cleanup * Fixed NOTE syntax * fixes * Update manifest.yml * Partial review * Fix target on SharedItems/OnSolutionLevel items * Review * Adjusted publish ifelse * Small Cleanup of info message in wizard concerning adding github workflows. * Update to latest versions * Fix casing for secrets file * Hide section about adding Catalog content. Is currently not supported * Small tweaks * Updated github dependabot and workflow for solution filters * no message * Prepare for release --------- Co-authored-by: Michiel Oda <michiel.oda@skyline.be> Co-authored-by: Marieke Goethals <94605575+MariekeGO@users.noreply.github.com> Co-authored-by: Marieke Goethals <marieke.goethals@skyline.be>
1 parent 930326e commit 2daa197

File tree

94 files changed

+2178
-3504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2178
-3504
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
**/bin/*
2-
**/obj/*
2+
**/obj/*
3+
**/.vs/*

working/templatepack.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageType>template</PackageType>
5-
<PackageVersion>1.0.18-alpha</PackageVersion>
5+
<PackageVersion>1.0.19-hades8</PackageVersion>
66
<PackageId>Skyline.DataMiner.VisualStudioTemplates</PackageId>
77
<Title>DataMiner DotNet Templates</Title>
88
<Authors>SkylineCommunications</Authors>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "nuget" # See documentation for possible values
9+
# directory: "/"
10+
directories: # Use this if you have no .sln file in your root.
11+
- "*"
12+
schedule:
13+
interval: "weekly"
14+
ignore:
15+
# FluentAssertions equal to or higher than 8.0.0 are a different license, which requires payment
16+
- dependency-name: "FluentAssertions"
17+
versions: [ ">=8.0.0" ]
18+
19+
# DevPacks represents the DMA on which to compile. Doesn't make sense to always be on the latest version.
20+
- dependency-name: "Skyline.DataMiner.Files.*"
21+
- dependency-name: "Skyline.DataMiner.Dev.*"
22+
groups:
23+
all-dependencies:
24+
patterns:
25+
- "*"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# This is a basic workflow, without the standard Skyline Quality Gate. It serves as a start and an example that can be extended as required.
2+
# Important: Every change to the master or main branch will upload a new package to the Catalog using a new prerelease version.
3+
# A stable release can be done by creating a tag or a GitHub Release.
4+
5+
6+
name: Basic Workflow
7+
8+
on:
9+
push:
10+
branches: [ "master", "main" ]
11+
tags:
12+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+"
13+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+-**"
14+
- "[0-9]+.[0-9]+.[0-9]+"
15+
- "[0-9]+.[0-9]+.[0-9]+-**"
16+
17+
# Allows you to run this workflow manually from the Actions tab
18+
workflow_dispatch:
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Validate DataMiner Secret Token
27+
id: validate-dataminer-token
28+
run: |
29+
if [[ -z "${{ secrets.DATAMINER_TOKEN }}" ]]; then
30+
echo "Error: DATAMINER_TOKEN is not set. Release not possible!"
31+
echo "Please create or re-use an admin.dataminer.services token by visiting: https://admin.dataminer.services/."
32+
echo "Navigate to the right Organization then go to Keys and create/find a key with permissions to Register Catalog Items."
33+
echo "Copy the value of the token."
34+
repo_url="https://github.com/${{ github.repository }}/settings/secrets/actions"
35+
echo "Then set a DATAMINER_TOKEN secret in your repository settings: $repo_url"
36+
exit 1
37+
fi
38+
39+
- name: Authenticate with GitHub CLI
40+
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
41+
42+
- name: Find Version Comment
43+
id: findVersionComment
44+
run: |
45+
echo "Checking for release notes associated with the reference: '${{ github.ref_name }}'"
46+
47+
# Retrieve the release note body
48+
RELEASE_NOTE=$(gh release view "${{ github.ref_name }}" --json body -q '.body' 2>/dev/null || echo "")
49+
50+
if [[ -n "$RELEASE_NOTE" ]]; then
51+
echo "Release note found for '${{ github.ref_name }}': $RELEASE_NOTE"
52+
# Escape multiline string for GITHUB_OUTPUT
53+
echo "versionComment<<EOF" >> $GITHUB_OUTPUT
54+
echo "$RELEASE_NOTE" >> $GITHUB_OUTPUT
55+
echo "EOF" >> $GITHUB_OUTPUT
56+
else
57+
echo "No release note found for '${{ github.ref_name }}'. Falling back to tag or commit message."
58+
VERSION_COMMENT=$(git describe --tags --exact-match 2>/dev/null || git log -1 --pretty=format:%s)
59+
echo "Fallback version comment: $VERSION_COMMENT"
60+
# Escape fallback as well
61+
echo "versionComment=$VERSION_COMMENT" >> $GITHUB_OUTPUT
62+
fi
63+
shell: bash
64+
65+
- name: Test
66+
run: dotnet test -c Release
67+
68+
- name: Publish Prerelease
69+
if: github.ref_type == 'branch'
70+
env:
71+
DATAMINER_TOKEN: ${{ secrets.DATAMINER_TOKEN }}
72+
shell: pwsh
73+
run: |
74+
dotnet publish `
75+
-p:Version="0.0.${{ github.run_number }}" `
76+
-p:VersionComment="${{ steps.findVersionComment.outputs.versionComment }}" `
77+
-p:CatalogPublishKeyName="DATAMINER_TOKEN" `
78+
-c Release `
79+
80+
- name: Publish Release
81+
if: github.ref_type == 'tag'
82+
env:
83+
DATAMINER_TOKEN: ${{ secrets.DATAMINER_TOKEN }}
84+
shell: pwsh
85+
run: |
86+
dotnet publish `
87+
-p:Version="${{ github.ref_name }}" `
88+
-p:VersionComment="${{ steps.findVersionComment.outputs.versionComment }}" `
89+
-p:CatalogPublishKeyName="DATAMINER_TOKEN" `
90+
-c Release `
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Skyline Reusable Quality Workflow
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches: []
8+
tags:
9+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+"
10+
- "[0-9]+.[0-9]+.[0-9]+.[0-9]+-**"
11+
- "[0-9]+.[0-9]+.[0-9]+"
12+
- "[0-9]+.[0-9]+.[0-9]+-**"
13+
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
20+
CI:
21+
uses: SkylineCommunications/_ReusableWorkflows/.github/workflows/DataMiner App Packages Master Workflow.yml@main
22+
with:
23+
configuration: Release
24+
referenceName: ${{ github.ref_name }}
25+
runNumber: ${{ github.run_number }}
26+
referenceType: ${{ github.ref_type }}
27+
repository: ${{ github.repository }}
28+
owner: ${{ github.repository_owner }}
29+
sonarCloudProjectName: ${{ vars.SONAR_NAME }} # Go to 'https://sonarcloud.io/projects/create' and create a project. Then create a SONAR_NAME variable with the ID of the project as mentioned in the SonarCloud project URL.
30+
# solutionFilterName: "MySolutionFilter.slnf"
31+
secrets:
32+
dataminerToken: ${{ secrets.DATAMINER_TOKEN }} # The API key: generated in the DCP Admin app (https://admin.dataminer.services/) as authentication for a certain DataMiner System.
33+
sonarCloudToken: ${{ secrets.SONAR_TOKEN }} # The API key for access to SonarCloud.
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# $SCRIPTNAME$
2+
3+
![WIP](./Images/wip.png)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# [Required]
2+
# Possible values for the Catalog item that can be deployed on a DataMiner System:
3+
# - Automation: If the Catalog item is a general-purpose DataMiner Automation script.
4+
# - Ad Hoc Data Source: If the Catalog item is a DataMiner Automation script designed for an ad hoc data source integration.
5+
# - ChatOps Extension: If the Catalog item is a DataMiner Automation script designed as a ChatOps extension.
6+
# - Connector: If the Catalog item is a DataMiner XML connector.
7+
# - Custom Solution: If the Catalog item is a DataMiner Solution.
8+
# - Data Query: If the Catalog item is a GQI data query.
9+
# - Data Transformer: Includes a data transformer that enables you to modify data using a GQI data query before making it available to users in low-code apps or dashboards.
10+
# - Dashboard: If the Catalog item is a DataMiner dashboard.
11+
# - DevTool: If the Catalog item is a DevTool.
12+
# - Learning & Sample: If the Catalog item is a sample.
13+
# - Product Solution: If the Catalog item is a DataMiner Solution that is an out-of-the-box solution for a specific product.
14+
# - Scripted Connector: If the Catalog item is a DataMiner scripted connector.
15+
# - Standard Solution: If the Catalog item is a DataMiner Solution that is an out-of-the-box solution for a specific use case or application.
16+
# - System Health: If the Catalog item is intended to monitor the health of a system.
17+
# - User-Defined API: If the Catalog item is a DataMiner Automation script designed as a user-defined API.
18+
# - Visual Overview: If the Catalog item is a Microsoft Visio design.
19+
#
20+
type: Custom Solution
21+
# [Required]
22+
# The ID of the Catalog item.
23+
# All registered versions for the same ID are shown together in the Catalog.
24+
# This ID cannot be changed.
25+
# If the ID is not filled in, the registration will fail with HTTP status code 500.
26+
# If the ID is filled in but does not exist yet, a new Catalog item will be registered with this ID.
27+
# If the ID is filled in but does exist, properties of the item will be overwritten.
28+
# Must be a valid GUID.
29+
id: 4c5d14ab-9cec-4c0b-8b58-af379fdb4123
30+
# [Required]
31+
# The human-friendly name of the Catalog item.
32+
# Can be changed at any time.
33+
# Max length: 100 characters.
34+
# Cannot contain newlines.
35+
# Cannot contain leading or trailing whitespace characters.
36+
title: $SCRIPTNAME$
37+
# [Optional]
38+
# General information about the Catalog item.
39+
# Max length: 100,000 characters
40+
short_description: This is a custom solution for DataMiner.
41+
# [Optional]
42+
# A valid URL that points to the source code.
43+
# A valid URL
44+
# Max length: 2048 characters
45+
# Note: When Skyline Communications Reusable GitHub workflows are used, this will be automatically filled in.
46+
source_code_url:
47+
# [Optional]
48+
# A valid URL that points to documentation.
49+
# A valid URL
50+
# Max length: 2048 characters
51+
# Note: When Skyline Communications Reusable GitHub workflows are used, this will be automatically filled in.
52+
documentation_url:
53+
# [Optional]
54+
# People who are responsible for this Catalog item. Might be developers, but this is not required.
55+
# Format: 'name <email> (URL)'
56+
# The name is required; max 256 characters.
57+
# The email and URL are optional, and should be in valid email/URL formats.
58+
owners:
59+
- name: '$AUTHOR$'
60+
# [Optional]
61+
# Tags that allow you to categorize your Catalog items.
62+
# Max number of tags: 5
63+
# Max length: 50 characters.
64+
# Cannot contain newlines.
65+
# Cannot contain leading or trailing whitespace characters.
66+
tags:
67+
- dataminer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"msbuild-sdks": {
3+
"Skyline.DataMiner.Sdk": "1.0.0"
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
DO NOT EDIT
4+
-->
5+
<Project>
6+
<PropertyGroup>
7+
<Configuration>Release</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>https://catalog.dataminer.services/details/4c5d14ab-9cec-4c0b-8b58-af379fdb4123</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<_TargetId>Folder</_TargetId>
12+
</PropertyGroup>
13+
</Project>

0 commit comments

Comments
 (0)