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

Bump dependabot/fetch-metadata from 1.6.0 to 2.2.0 #408

Open
wants to merge 365 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
365 commits
Select commit Hold shift + click to select a range
e37e25a
Update create-learning-path-update.yml
kkeirstead Jan 24, 2024
e7e08c0
Update scan-for-learning-path-update-comments.yml
kkeirstead Jan 24, 2024
8546a5b
Update scan-for-to-do-comments.yml
kkeirstead Jan 24, 2024
1cd92ec
Update scan-for-to-do-comments.yml
kkeirstead Jan 24, 2024
71914d8
Update scan-for-learning-path-update-comments.yml
kkeirstead Jan 24, 2024
8015caa
Update create-learning-path-update.yml
kkeirstead Jan 24, 2024
bd0b171
Update scan-for-learning-path-update-comments.yml
kkeirstead Jan 24, 2024
6ca7e20
Update scan-for-learning-path-update-comments.yml
kkeirstead Jan 24, 2024
de545b8
Update scan-for-learning-path-update-comments.yml
kkeirstead Jan 24, 2024
29e6db3
Update create-learning-path-update.yml
kkeirstead Jan 24, 2024
dd8f585
Update create-learning-path-update.yml
kkeirstead Jan 24, 2024
5484736
Update scan-for-learning-path-update-comments.yml
kkeirstead Jan 24, 2024
bb2c28b
Update create-learning-path-update.yml
kkeirstead Jan 24, 2024
7eff2fd
Update scan-for-learning-path-update-comments.yml
kkeirstead Jan 24, 2024
c8d184e
Update Learning Path Links
invalid-email-address Jan 24, 2024
5071b6f
Update submit-stale-learning-path-issue.yml
kkeirstead Jan 24, 2024
1a5dfba
Merge pull request #289 from kkeirstead/bot/learningPathUpdates/7eff2…
kkeirstead Jan 24, 2024
47685e7
Update EgressHelper.cs
kkeirstead Jan 24, 2024
09fce46
Update submit-stale-learning-path-issue.yml
kkeirstead Jan 24, 2024
da10a90
Update check-learning-path-links.yml
kkeirstead Jan 24, 2024
c3d2182
Update check-learning-path-links.yml
kkeirstead Jan 24, 2024
8459ff7
Update check-learning-path-links.yml
kkeirstead Jan 24, 2024
333417e
Update submit-stale-learning-path-issue.yml
kkeirstead Jan 25, 2024
20959a2
Update check-learning-path-links.yml
kkeirstead Jan 25, 2024
4af46e7
Update submit-stale-learning-path-issue.yml
kkeirstead Jan 25, 2024
bd48ba2
Update configuration.md
kkeirstead Jan 25, 2024
2005c6e
Update check-learning-path-links.yml
kkeirstead Jan 25, 2024
795d63a
Update architecture.md
kkeirstead Jan 25, 2024
a9c2888
Update configuration.md
kkeirstead Jan 25, 2024
0a6fbf8
Update configuration.md
kkeirstead Jan 25, 2024
a911870
Update aks.md
kkeirstead Jan 25, 2024
13fd703
Rename EgressHelper.cs to EgressHelperTEMP.cs
kkeirstead Jan 25, 2024
30b794e
Rename EgressHelperTEMP.cs to EgressHelper.cs
kkeirstead Jan 25, 2024
47e7c80
Update check-learning-path-links.yml
kkeirstead Jan 25, 2024
6b9d061
Update submit-stale-learning-path-issue.yml
kkeirstead Jan 25, 2024
afdd7c0
Delete .github/workflows/submit-learning-paths-staleness-check.yml
kkeirstead Jan 25, 2024
7ee6f16
Delete .github/workflows/check-learning-path-links-anchor.yml
kkeirstead Jan 25, 2024
d74672e
Update submit-stale-learning-path-issue.yml
kkeirstead Jan 25, 2024
17808f2
Update submit-stale-learning-path-issue.yml
kkeirstead Jan 25, 2024
b32edc1
Update and rename submit-stale-learning-path-issue.yml to submit-lear…
kkeirstead Jan 25, 2024
3a74409
Update and rename scan-for-learning-path-update-comments.yml to scan-…
kkeirstead Jan 25, 2024
e343e69
Update scan-for-learning-path-comments.yml
kkeirstead Jan 25, 2024
6656e64
Update and rename create-learning-path-update.yml to submit-learning-…
kkeirstead Jan 25, 2024
944656c
Update scan-for-learning-path-comments.yml
kkeirstead Jan 25, 2024
90551b9
Update submit-learning-path-pr.yml
kkeirstead Jan 25, 2024
3e4b077
Update check-learning-path-links.yml
kkeirstead Jan 25, 2024
404b484
Update check-learning-path-links.yml
kkeirstead Jan 25, 2024
f45983f
Update configuration.md
kkeirstead Jan 25, 2024
da4874b
Update submit-learning-path-issue.yml
kkeirstead Jan 25, 2024
c8e72b6
Update scan-for-learning-path-comments.yml
kkeirstead Jan 25, 2024
96dcc63
Update submit-learning-path-pr.yml
kkeirstead Jan 26, 2024
885ade7
Update submit-learning-path-pr.yml
kkeirstead Jan 26, 2024
e4a7465
Update submit-learning-path-pr.yml
kkeirstead Jan 26, 2024
63a4315
Delete .github/workflows/submit-to-do-issue.yml
kkeirstead Jan 26, 2024
8a6c1ed
Create submit-to-do-issue.yml
kkeirstead Jan 26, 2024
820b7dd
Delete .github/workflows/submit-learning-path-issue.yml
kkeirstead Jan 26, 2024
b2aafd4
Delete .github/workflows/scan-for-learning-path-comments.yml
kkeirstead Jan 26, 2024
c198c72
Update check-learning-path-links.yml
kkeirstead Jan 26, 2024
e33dfb5
Update check-learning-path-links.yml
kkeirstead Jan 26, 2024
e760400
Update check-learning-path-links.yml
kkeirstead Jan 26, 2024
8b93d30
Update Learning Paths
invalid-email-address Jan 26, 2024
3b4d5e1
Update egress.md
kkeirstead Jan 26, 2024
945678a
Merge pull request #332 from kkeirstead/bot/learningPathUpdates/e7604…
kkeirstead Jan 26, 2024
88f8a4d
Update CollectionRuleOptions.cs
kkeirstead Jan 26, 2024
5d36cc1
Update collectionrules.md
kkeirstead Jan 26, 2024
0ccb077
Update ServiceCollectionExtensions.cs
kkeirstead Jan 26, 2024
508030e
Update and rename ConfigShowCommandHandler.cs to ConfigShowCommandHan…
kkeirstead Jan 26, 2024
be02c3d
Update CollectCommandHandler.cs
kkeirstead Jan 26, 2024
5dd67fb
Update TargetFrameworkMonikerTraitAttribute.cs
kkeirstead Jan 26, 2024
f951005
Update testing.md
kkeirstead Jan 26, 2024
47a07b6
Update EgressHelper.cs
kkeirstead Jan 26, 2024
17b1017
Update EgressExtension.cs
kkeirstead Jan 26, 2024
df4ec82
Update ServiceCollectionExtensions.cs
kkeirstead Jan 29, 2024
9da2478
Update EgressExtension.cs
kkeirstead Jan 29, 2024
b4fb1d6
Update and rename ConfigShowCommandHandlerTEST.cs to ConfigShowComman…
kkeirstead Jan 29, 2024
458f303
Update CollectCommandHandler.cs
kkeirstead Jan 29, 2024
9f83714
Update TargetFrameworkMonikerTraitAttribute.cs
kkeirstead Jan 29, 2024
0182113
Update CollectionRuleOptions.cs
kkeirstead Jan 29, 2024
151a730
Update CollectionRulePipelineState.cs
kkeirstead Jan 29, 2024
f076b0f
Update EgressHelper.cs
kkeirstead Jan 29, 2024
5e4d90f
Update submit-linter-suggestions.yml
kkeirstead Jan 29, 2024
74be50b
Update submit-to-do-issue.yml
kkeirstead Jan 29, 2024
e55607f
Update testing.md
kkeirstead Jan 29, 2024
c8c2de5
Update check-learning-path-links.yml
kkeirstead Jan 29, 2024
241194b
Update submit-learning-path-pr.yml
kkeirstead Jan 29, 2024
b84dfd6
Merge branch 'dotnet:main' into main
kkeirstead Jan 29, 2024
dfbe294
Update collectionrules.md
kkeirstead Jan 29, 2024
a59cc50
Update api.md
kkeirstead Jan 29, 2024
34aa1a3
Update aks.md
kkeirstead Jan 29, 2024
82da20e
Update configuration.md
kkeirstead Jan 29, 2024
090dd8c
Update egress.md
kkeirstead Jan 29, 2024
b34294d
Update testing.md
kkeirstead Jan 29, 2024
e35fc7d
Update learning-path-sha.txt
kkeirstead Jan 29, 2024
8bdc20a
Create index.js
kkeirstead Jan 29, 2024
8540f4c
Create action.yml
kkeirstead Jan 29, 2024
6882f9c
Rename action.yml to action.yml
kkeirstead Jan 29, 2024
952f10c
Rename index.js to index.js
kkeirstead Jan 29, 2024
1a348ba
Create index.js
kkeirstead Jan 29, 2024
ea1dd10
Create action.yml
kkeirstead Jan 29, 2024
02341c2
Rename .github/apply-learning-path-updates/action.yml to .github/acti…
kkeirstead Jan 29, 2024
d427f0c
Rename .github/apply-learning-path-updates/index.js to .github/action…
kkeirstead Jan 29, 2024
19b027a
Update index.js
kkeirstead Jan 29, 2024
6e08498
Update index.js
kkeirstead Jan 29, 2024
033256f
Update submit-learning-path-pr.yml
kkeirstead Jan 29, 2024
8cf3318
Update check-learning-path-links.yml
kkeirstead Jan 29, 2024
544d8c3
Merge pull request #335 from kkeirstead/kkeirstead/LearningPathStalen…
kkeirstead Jan 29, 2024
f886104
Update ServiceCollectionExtensions.cs
kkeirstead Jan 29, 2024
7fae97a
Update ServiceCollectionExtensions.cs
kkeirstead Jan 29, 2024
42c9dc3
Update api.md
kkeirstead Jan 29, 2024
b8b605f
Update collectionrules.md
kkeirstead Jan 29, 2024
214cbf4
Update configuration.md
kkeirstead Jan 29, 2024
d353d8b
Update egress.md
kkeirstead Jan 29, 2024
53da42f
Update submit-learning-path-pr.yml
kkeirstead Jan 29, 2024
48d09af
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
ac34280
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
7cb22ae
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
ddf4b9d
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
48d4e8c
Delete .github/workflows/submit-learning-path-pr.yml
kkeirstead Jan 31, 2024
d348948
Merge pull request #336 from kkeirstead/kkeirstead/learning_staleness…
kkeirstead Jan 31, 2024
ede7c2f
Update index.js
kkeirstead Jan 31, 2024
3726868
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
814013a
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
a693f1d
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
d3f849c
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
5795d66
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
684b455
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
fddb21b
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
371b29b
Update ServiceCollectionExtensions.cs
kkeirstead Jan 31, 2024
ce48f46
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
aa165a3
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
358a4f3
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
394b8c9
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
c1a1c9e
Update ServiceCollectionExtensions.cs
kkeirstead Jan 31, 2024
422d445
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
c1235a5
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
50c6ce6
Update ServiceCollectionExtensions.cs
kkeirstead Jan 31, 2024
b737674
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
757f0b7
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
76b4877
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
604aa41
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
e5dfdc5
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
2530d3a
Update ServiceCollectionExtensions.cs
kkeirstead Jan 31, 2024
bea5b02
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
bf7aef4
Update EgressHelper.cs
kkeirstead Jan 31, 2024
48964a8
Update EgressHelper.cs
kkeirstead Jan 31, 2024
d634733
Update ServiceCollectionExtensions.cs
kkeirstead Jan 31, 2024
f7878f5
Update action.yml
kkeirstead Jan 31, 2024
3ed44c6
Update index.js
kkeirstead Jan 31, 2024
3f0ac61
Delete .github/actions/apply-learning-path-updates directory
kkeirstead Jan 31, 2024
d434c92
Update check-learning-path-links.yml
kkeirstead Jan 31, 2024
64fb591
Update collectionrules.md
kkeirstead Jan 31, 2024
d4e2f16
Update index.js
kkeirstead Jan 31, 2024
d174dfd
Update index.js
kkeirstead Jan 31, 2024
8ceb927
Update ServiceCollectionExtensions.cs
kkeirstead Jan 31, 2024
268d768
Update action-utils.js
kkeirstead Jan 31, 2024
59cc2c7
Update action-utils.js
kkeirstead Jan 31, 2024
3688742
Update index.js
kkeirstead Jan 31, 2024
9846603
Update index.js
kkeirstead Jan 31, 2024
63bb41a
Update action-utils.js
kkeirstead Jan 31, 2024
32dd3b2
Update index.js
kkeirstead Jan 31, 2024
60396d0
Update index.js
kkeirstead Jan 31, 2024
11bc73f
Update action-utils.js
kkeirstead Jan 31, 2024
0feef6e
Update index.js
kkeirstead Jan 31, 2024
38df0a2
Update index.js
kkeirstead Jan 31, 2024
e51b987
Update action-utils.js
kkeirstead Jan 31, 2024
b972bd5
Update EgressHelper.cs
kkeirstead Jan 31, 2024
3b0cbae
Update ServiceCollectionExtensions.cs
kkeirstead Jan 31, 2024
a41b4d3
Update EgressHelper.cs
kkeirstead Jan 31, 2024
1ae5b4b
Update index.js
kkeirstead Jan 31, 2024
f60f750
Update EgressHelper.cs
kkeirstead Jan 31, 2024
dcb8db8
Update EgressHelper.cs
kkeirstead Jan 31, 2024
27a09b0
Merge pull request #366 from kkeirstead/main
kkeirstead Jan 31, 2024
3f0a41e
Update index.js
kkeirstead Feb 1, 2024
9e441c0
Update check-learning-path-links.yml
kkeirstead Feb 1, 2024
8a963a9
Update EgressHelper.cs
kkeirstead Feb 1, 2024
8ebfd99
Update check-learning-path-links.yml
kkeirstead Feb 1, 2024
bb78446
Update index.js
kkeirstead Feb 1, 2024
e8bd6e6
Update index.js
kkeirstead Feb 1, 2024
7600fb7
Update EgressHelper.cs
kkeirstead Feb 1, 2024
d6e4f30
Flow changes from main to feature branch (#369)
kkeirstead Feb 1, 2024
58643ce
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
d51b668
Update EgressHelper.cs
kkeirstead Feb 2, 2024
cfb1730
Update index.js
kkeirstead Feb 2, 2024
d6db61d
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
1be03fb
Update action.yml
kkeirstead Feb 2, 2024
865322a
Update action.yml
kkeirstead Feb 2, 2024
d2d5d25
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
f92dff2
Update action.yml
kkeirstead Feb 2, 2024
d0c9eb1
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
a2bba10
Update action.yml
kkeirstead Feb 2, 2024
08cf0d4
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
3b4f5fb
Update action.yml
kkeirstead Feb 2, 2024
70129cb
Update action.yml
kkeirstead Feb 2, 2024
97819ff
Update index.js
kkeirstead Feb 2, 2024
58e96f4
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
d4521e4
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
a732984
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
12f15ab
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
194989a
Update action.yml
kkeirstead Feb 2, 2024
21f1847
Update index.js
kkeirstead Feb 2, 2024
cd897b1
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
ac92422
Update index.js
kkeirstead Feb 2, 2024
02b7e13
Update index.js
kkeirstead Feb 2, 2024
f175768
Update index.js
kkeirstead Feb 2, 2024
ed0d0ea
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
384d33a
Update action.yml
kkeirstead Feb 2, 2024
10f3c72
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
00a49a5
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
afb2c1f
Update action.yml
kkeirstead Feb 2, 2024
d20cfa5
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
c03cdca
Update index.js
kkeirstead Feb 2, 2024
8005f35
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
978fbc6
Update EgressHelper.cs
kkeirstead Feb 2, 2024
1a18acb
Update index.js
kkeirstead Feb 2, 2024
4a08e9c
Update EgressHelper.cs
kkeirstead Feb 2, 2024
131cd2a
Update index.js
kkeirstead Feb 2, 2024
56d2aba
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
9ccbdc8
Update index.js
kkeirstead Feb 2, 2024
35dd890
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
567892d
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
68fa361
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
f715577
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
7b2f5d2
Update index.js
kkeirstead Feb 2, 2024
865b4a9
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
049a599
Update check-learning-path-links.yml
kkeirstead Feb 2, 2024
6aaae4a
Update index.js
kkeirstead Feb 2, 2024
3e16ca9
Update index.js
kkeirstead Feb 2, 2024
23eaa0a
Update index.js
kkeirstead Feb 2, 2024
31c6820
Update index.js
kkeirstead Feb 2, 2024
53f00e1
Update action-utils.js
kkeirstead Feb 2, 2024
a65df3b
Update ServiceCollectionExtensions.cs
kkeirstead Feb 2, 2024
27aace0
Update ServiceCollectionExtensions.cs
kkeirstead Feb 2, 2024
6303b85
Update EgressHelper.cs
kkeirstead Feb 2, 2024
9985bce
Merge branch 'kkeirstead/StalenessPRFeedbackAddressed' into main
kkeirstead Feb 2, 2024
6cb380a
Flowing bits (#376)
kkeirstead Feb 2, 2024
1251aaa
Update action-utils.js
kkeirstead Feb 2, 2024
2a80c4c
Update index.js
kkeirstead Feb 2, 2024
487c3b4
Update EgressHelper.cs
kkeirstead Feb 2, 2024
e4d0656
Update ServiceCollectionExtensions.cs
kkeirstead Feb 2, 2024
130c325
Update index.js
kkeirstead Feb 2, 2024
eda2821
Update index.js
kkeirstead Feb 2, 2024
5f19978
Update index.js
kkeirstead Feb 2, 2024
0efd390
Update index.js
kkeirstead Feb 2, 2024
953d566
Update ServiceCollectionExtensions.cs
kkeirstead Feb 2, 2024
43b057d
Update EgressHelper.cs
kkeirstead Feb 2, 2024
c3f0434
Merge branch 'kkeirstead/StalenessPRFeedbackAddressed' into main
kkeirstead Feb 2, 2024
64b90b2
Flowing bits (#394)
kkeirstead Feb 2, 2024
f0aa8ed
Update index.js
kkeirstead Feb 2, 2024
7c555a6
Merge branch 'kkeirstead/StalenessPRFeedbackAddressed' into main
kkeirstead Feb 2, 2024
ecdb2f5
Bump dependabot/fetch-metadata from 1.6.0 to 2.2.0
dependabot[bot] Jul 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/action-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ module.exports.friendlyDateFromISODate = function(isoDate) {

module.exports.splitVersionTag = splitVersionTag;
module.exports.readFile = (fileName) => util.promisify(fs.readFile)(fileName, 'utf8');
module.exports.writeFile = (fileName, contents) => util.promisify(fs.writeFile)(fileName, contents);
module.exports.writeFile = (fileName, contents) => util.promisify(fs.writeFile)(fileName, contents);
30 changes: 30 additions & 0 deletions .github/actions/learning-path-staleness-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'CheckLearningPathLinks Action'
description: 'Checks the links in the learning paths for staleness'
inputs:
repoURLToSearch:
description: 'The repo referenced in the learning path docs (in URL form)'
required: true
learningPathsDirectory:
description: 'The directory where the learning paths reside (e.g. documentation/learningPath)'
required: true
changedFilePaths:
description: 'Paths to the changed files'
required: false
sourceDirectoryName:
description: 'The name of the top-level directory (e.g. src) - only files inside this directory will be included in the search'
required: true
oldHash:
description: 'The hash currently being used by the learning path'
required: true
newHash:
description: 'The hash to be inserted into the updated learning path'
required: true
learningPathHashFile:
description: 'The file where the commit hash being used for the learning paths is kept'
required: true
excludeLinks:
description: 'Comma separated strings to exclude from processing'
required: false
runs:
using: 'node16'
main: 'index.js'
274 changes: 274 additions & 0 deletions .github/actions/learning-path-staleness-check/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
const actionUtils = require('../action-utils.js');
const fs = require('fs');
const path = require('path');
const prevPathPrefix = "prev/";
const linePrefix = "#L";
const separator = " | ";

modifiedFilesPathToLearningPathFile = {};
modifiedFilesUrlToFileName = {};

var outOfSync = new Set();
var manuallyReview = new Set();
var suggestions = new Set();
var modifiedFiles = new Set();

const oldNewLinkSeparator = ' -> ';

function ReplaceOldWithNewText(content, oldText, newText)
{
return content.replaceAll(oldText, newText);
}

function UpdateModifiedFiles(fileName, path, learningPathFile)
{
modifiedFilesUrlToFileName[path] = fileName;

modifiedFilesPathToLearningPathFile[path] = modifiedFilesPathToLearningPathFile[path] ? modifiedFilesPathToLearningPathFile[path] : new Set();;
modifiedFilesPathToLearningPathFile[path].add(learningPathFile);

modifiedFiles = new Set();
for (currPath in modifiedFilesPathToLearningPathFile)
{
const fileName = modifiedFilesUrlToFileName[currPath];
modifiedFiles.add(AssembleModifiedFilesOutput(fileName, currPath, Array.from(modifiedFilesPathToLearningPathFile[currPath])));
}
}

function AssembleModifiedFilesOutput(fileName, path, learningPathFiles)
{
return CreateLink(fileName, path, undefined) + separator + BoldedText(learningPathFiles.join(" "));
}

function BoldedText(text)
{
return "**" + text + "**";
}

function UpdateManuallyReview(fileName, path, learningPathFile, learningPathLineNumber, lineNumber = undefined)
{
manuallyReview.add(AssembleOutput(fileName, path, undefined, lineNumber, undefined, learningPathFile, learningPathLineNumber))
}

function UpdateOutOfSync(link, learningPathFile)
{
outOfSync.add(link + separator + BoldedText(learningPathFile))
}

function UpdateSuggestions(fileName, oldPath, newPath, learningPathFile, learningPathLineNumber, oldLineNumber, newLineNumber)
{
suggestions.add(AssembleOutput(fileName, oldPath, newPath, oldLineNumber, newLineNumber, learningPathFile, learningPathLineNumber))
}

function CreateLink(fileName, path, lineNumber)
{
var codeFileLink = "[" + fileName + "]" + "(" + path + ")"
return AppendLineNumber(codeFileLink, lineNumber)
}

function AssembleOutput(fileName, oldPath, newPath, oldLineNumber, newLineNumber, learningPathFile, learningPathLineNumber)
{
var codeFileLink = CreateLink(fileName, oldPath, oldLineNumber)

if (newPath && newLineNumber) {
codeFileLink += oldNewLinkSeparator + CreateLink(fileName, newPath, newLineNumber)
}

return codeFileLink + separator + BoldedText(AppendLineNumber(learningPathFile, learningPathLineNumber, undefined));
}

function AppendLineNumber(text, lineNumber)
{
if (!lineNumber) { return text }

return text + " " + linePrefix + lineNumber
}

function CheckForEndOfLink(str, startIndex)
{
const illegalCharIndex = str.substr(startIndex).search(/[\>\])\s]|$|.$|.\s/m); // This regex isn't perfect, but should cover most cases.
return illegalCharIndex;
}

function StripLineNumber(link, linePrefixIndex)
{
return link.substring(0, linePrefixIndex);
}

function GetContent(path) {
try {
return fs.readFileSync(path, 'utf8');
}
catch (error) {}

return undefined;
}

function ConstructOutputText(core)
{
var body = "";

if (manuallyReview.size > 0) { body += "<h2>Manually Review:</h2>" + Array.from(manuallyReview).join("<br />") + "<br />"; }

if (outOfSync.size > 0) { body += "<h2>Links With Out Of Sync Commit Hashes:</h2>" + Array.from(outOfSync).join("<br />") + "<br />"; }

if (suggestions.size > 0) { body += "<h2>Auto-Applied Suggestions:</h2>" + Array.from(suggestions).join("<br />") + "<br />"; }

if (modifiedFiles.size > 0) { body += "<h2>Modified Files:</h2>" + Array.from(modifiedFiles).join("<br />") + "<br />"; }

console.log("body=" + body);
core.setOutput('outputText', body);
}

function ValidateLinks(learningPathContents, repoURLToSearch, modifiedPRFiles, learningPathFile, oldHash, newHash, sourceDirectoryName, excludeLinksArray)
{
// Get all indices where a link to the repo is found within the current learning path file
var linkIndices = [];
for(var pos = learningPathContents.indexOf(repoURLToSearch); pos !== -1; pos = learningPathContents.indexOf(repoURLToSearch, pos + 1)) {
linkIndices.push(pos);
}

for(let startOfLink of linkIndices)
{
// Clean up the link, determine if it has a line number suffix
let endOfLink = startOfLink + CheckForEndOfLink(learningPathContents, startOfLink)
if (endOfLink < startOfLink) { endOfLink = learningPathContents.length; } // If no illegal characters are found, the link is at the end of the file

const link = learningPathContents.substring(startOfLink, endOfLink);

if (excludeLinksArray.some(excludeLink => link.toLowerCase().includes(excludeLink))) { continue; }

const pathStartIndex = link.indexOf(sourceDirectoryName);

if (pathStartIndex === -1) { continue }

if (!link.includes(oldHash))
{
UpdateOutOfSync(link, learningPathFile);
continue
}

const linePrefixIndex = link.indexOf(linePrefix);
const linkHasLineNumber = linePrefixIndex !== -1;
const pathEndIndex = linkHasLineNumber ? linePrefixIndex : endOfLink;

// Check if the file being referenced by the link is one of the modified files in the PR
const linkFilePath = link.substring(pathStartIndex, pathEndIndex);
if (modifiedPRFiles.includes(linkFilePath))
{
const fileName = linkFilePath.substring(linkFilePath.lastIndexOf('/') + 1);

UpdateModifiedFiles(fileName, linkHasLineNumber ? StripLineNumber(link, linePrefixIndex) : link, learningPathFile);

// This is the line number in the learning path file that contains the link - not the #L line number in the link itself
const learningPathLineNumber = learningPathContents.substring(0, startOfLink).split("\n").length;

var headContent = GetContent(linkFilePath)
if (!headContent) {
UpdateManuallyReview(fileName, link, learningPathFile, learningPathLineNumber);
continue
}
const headContentLines = headContent.toString().split("\n");

if (!linkHasLineNumber) { continue; }
const oldLineNumber = Number(link.substring(linePrefixIndex + linePrefix.length, link.length));

var prevContent = GetContent(prevPathPrefix + linkFilePath)
if (!prevContent) { continue; }
const prevContentLines = prevContent.toString().split("\n");

if (prevContentLines.length < oldLineNumber)
{
UpdateManuallyReview(fileName, link, learningPathFile, learningPathLineNumber, oldLineNumber);
}
else if (headContentLines.length < oldLineNumber || prevContentLines[oldLineNumber - 1].trim() !== headContentLines[oldLineNumber - 1].trim())
{
const newLineNumberLast = headContentLines.lastIndexOf(prevContentLines[oldLineNumber - 1]) + 1;
const newLineNumberFirst = headContentLines.indexOf(prevContentLines[oldLineNumber - 1]) + 1;

if (newLineNumberLast !== newLineNumberFirst) // Multiple matches found in the file
{
UpdateManuallyReview(fileName, link, learningPathFile, learningPathLineNumber, oldLineNumber);
}
else
{
let updatedLink = StripLineNumber(link.replace(oldHash, newHash), linePrefixIndex) + linePrefix + newLineNumberFirst;
UpdateSuggestions(fileName, link, updatedLink, learningPathFile, learningPathLineNumber, oldLineNumber, newLineNumberFirst);
}
}
}
}
}

const main = async () => {

const [core] = await actionUtils.installAndRequirePackages("@actions/core");

try {
const learningPathDirectory = core.getInput('learningPathsDirectory', { required: true });
const repoURLToSearch = core.getInput('repoURLToSearch', { required: true });
const changedFilePaths = core.getInput('changedFilePaths', {required: false});
const learningPathHashFile = core.getInput('learningPathHashFile', { required: true });
const sourceDirectoryName = core.getInput('sourceDirectoryName', { required: true });
const oldHash = core.getInput('oldHash', { required: true });
const newHash = core.getInput('newHash', { required: true });
const excludeLinks = core.getInput('excludeLinks', { required: false });
const excludeLinksArray = excludeLinks ? excludeLinks.split(',').map(function(item) { return item.toLowerCase().trim() }) : [];

if (changedFilePaths === null || changedFilePaths.trim() === "") { return }

// Scan each file in the learningPaths directory
fs.readdir(learningPathDirectory, (_, files) => {
files.forEach(learningPathFile => {
try {
const learningPathContents = GetContent(path.join(learningPathDirectory, learningPathFile))
if (learningPathContents)
{
ValidateLinks(learningPathContents, repoURLToSearch, changedFilePaths.split(' '), learningPathFile, oldHash, newHash, sourceDirectoryName, excludeLinksArray)
ConstructOutputText(core);
}
} catch (error) {
console.log("Error: " + error)
console.log("Could not find learning path file: " + learningPathFile)
}
});
});

fs.writeFileSync(learningPathHashFile, newHash);

// Scan each file in the learningPaths directory
fs.readdir(learningPathDirectory, (_, files) => {

files.forEach(learningPathFile => {
try {
const fullPath = path.join(learningPathDirectory, learningPathFile)
let content = fs.readFileSync(fullPath, 'utf8')

let suggestionsArray = Array.from(suggestions);
if (suggestionsArray && suggestionsArray.length > 0) {
suggestionsArray.forEach(suggestion => {
const suggestionArray = suggestion.split(oldNewLinkSeparator)
var oldLink = suggestionArray[0]
var newLink = suggestionArray[1]
oldLink = oldLink.substring(oldLink.indexOf('(') + 1, oldLink.lastIndexOf(')'))
newLink = newLink.substring(newLink.indexOf('(') + 1, newLink.lastIndexOf(')'))
content = ReplaceOldWithNewText(content, oldLink, newLink)
})
}

content = ReplaceOldWithNewText(content, oldHash, newHash)
fs.writeFileSync(fullPath, content);
} catch (error) {
console.log("Error: " + error)
console.log("Could not find learning path file: " + learningPathFile)
}
});
});

} catch (error) {
core.setFailed(error.message);
}
}

// Call the main function to run the action
main();
1 change: 1 addition & 0 deletions .github/learning-path-sha.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
341ff64a6097fe0bc66950e254e6160abcf77b84
65 changes: 65 additions & 0 deletions .github/workflows/check-learning-path-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Check Learning Path Links'
on:
schedule: # Run once a month
- cron: '0 0 1 * *'
workflow_dispatch:

permissions: {}

jobs:
check-learning-path-links:
name: 'Check Learning Path Links'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout head
uses: actions/checkout@v4
with:
persist-credentials: true # need this for opening a PR
fetch-depth: 0
ref: main

- name: Get previous update SHA
id: get_sha
run: |
prev_sha=$(cat .github/learning-path-sha.txt)
echo "prev_sha=$prev_sha" >> $GITHUB_ENV

- name: Checkout previous update
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ env.prev_sha }}
path: prev

- name: Get changed files
run: |
changed_source_files=$(git diff-tree --no-commit-id --name-only -r "$prev_sha" "$GITHUB_SHA" | { grep "**.cs$" || test $? = 1; })
echo "Files to validate: '${changed_source_files}'"
echo "updated_files=$(echo ${changed_source_files})" >> $GITHUB_ENV

- name: Check Learning Path Links
id: check-links
uses: ./.github/actions/learning-path-staleness-check
with:
repoURLToSearch: 'https://github.com/dotnet/dotnet-monitor'
learningPathsDirectory: 'documentation/learningPath'
changedFilePaths: ${{ env.updated_files }}
sourceDirectoryName: 'src'
oldHash: ${{ env.prev_sha }}
newHash: ${{ github.sha }}
learningPathHashFile: '.github/learning-path-sha.txt'

- name: Open PR
uses: ./.github/actions/open-pr
with:
files_to_commit: --all -- :!prev
title: "[REQUIRES MANUAL REVIEW] Update Learning Paths"
commit_message: Update Learning Paths
body: This PR was auto generated and will not be automatically merged in - adjustments should be made manually as-needed.<br />${{ steps.check-links.outputs.outputText }}
branch_name: learningPathUpdates/${{ github.sha }}
fail_if_files_unchanged: true
auth_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/verify-dependabot-clearly-defined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526
uses: dependabot/fetch-metadata@dbb049abf0d677abbd7f7eee0375145b417fdd34

- name: Check ClearlyDefined
if: ${{steps.metadata.outputs.package-ecosystem == 'nuget'}}
Expand Down
2 changes: 1 addition & 1 deletion documentation/learningPath/aks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In addition to its availability as a .NET CLI tool, the `dotnet monitor` tool is

This workflow takes your local development copy of `dotnet-monitor`, patches it with a local development copy of the [.NET Core Diagnostics Repo](https://github.com/dotnet/diagnostics#net-core-diagnostics-repo), and makes it available as an image for you to consume in an ACR (Azure Container Registry). Note that there are many other ways to do this - this is meant to serve as a basic template that can be adapted to match your needs.

1. Open `pwsh` and run the [generate-dev-sln script](https://github.com/dotnet/dotnet-monitor/blob/main/generate-dev-sln.ps1), providing a path to your local copy of the diagnostics repo.
1. Open `pwsh` and run the [generate-dev-sln script](https://github.com/dotnet/dotnet-monitor/blob/341ff64a6097fe0bc66950e254e6160abcf77b84/generate-dev-sln.ps1), providing a path to your local copy of the diagnostics repo.

> [!NOTE]
> If your changes do not involve the [.NET Core Diagnostics Repo](https://github.com/dotnet/diagnostics#net-core-diagnostics-repo), you don't need to complete this step.
Expand Down
Loading