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

Update TimeProvider.cs #232

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7dbd0fb
Put Learning Path In-Progress Staleness Checker Back In Main
kkeirstead Oct 2, 2023
0d45cbd
Update architecture.md
kkeirstead Oct 2, 2023
67cf509
Update collectionrules.md
kkeirstead Oct 2, 2023
1673989
Update collectionrules.md
kkeirstead Oct 2, 2023
5b5de00
Update check-learning-path-links.yml
kkeirstead Oct 2, 2023
9ce6f72
Update check-learning-path-links.yml
kkeirstead Oct 3, 2023
0598e8a
Update check-learning-path-links.yml
kkeirstead Oct 3, 2023
88ac574
Update submit-linter-suggestions.yml
kkeirstead Oct 3, 2023
e7d6ae7
Update check-learning-path-links.yml
kkeirstead Oct 3, 2023
8fba8a1
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
c5895d0
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
7c7530d
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
7c8f459
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
bf6c353
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
7d7aa67
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
8bb85e2
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
944ea6d
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
a960d51
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
506152d
Update submit-learning-paths-staleness-check.yml
kkeirstead Oct 3, 2023
84604ad
Update submit-linter-suggestions.yml
kkeirstead Oct 4, 2023
c360b09
Update check-learning-path-links.yml
kkeirstead Oct 4, 2023
62d84cb
Update check-learning-path-links.yml
kkeirstead Oct 4, 2023
82c54b4
Update configuration.md
kkeirstead Oct 4, 2023
0a1a0f7
Update collectionrules.md
kkeirstead Oct 4, 2023
b287d1b
Update testing.md
kkeirstead Oct 4, 2023
0d1afa3
Update check-learning-path-links.yml
kkeirstead Oct 6, 2023
9394604
Update CollectionRulePipelineState.cs
kkeirstead Oct 6, 2023
68ba9e9
Update collectionrules.md
kkeirstead Oct 6, 2023
022fe98
Create check-learning-path-links-anchor.yml
kkeirstead Oct 6, 2023
bc9c983
Update check-learning-path-links-anchor.yml
kkeirstead Oct 6, 2023
ad09906
Update TimeProvider.cs
kkeirstead Oct 6, 2023
0b68fb8
Update TimeProvider.cs
kkeirstead Oct 6, 2023
7d945db
Update TimeProvider.cs
kkeirstead Oct 6, 2023
190f76f
Update TimeProvider.cs
kkeirstead Oct 6, 2023
ca4873a
Update TimeProvider.cs
kkeirstead Oct 6, 2023
5e0daac
Update TimeProvider.cs
kkeirstead Oct 6, 2023
de60d6b
Update TimeProvider.cs
kkeirstead Oct 6, 2023
4ec8c9c
Update TimeProvider.cs
kkeirstead Oct 6, 2023
3b5d955
Update TimeProvider.cs
kkeirstead Oct 6, 2023
0d697cd
Update TimeProvider.cs
kkeirstead Oct 6, 2023
bdbac80
Update TimeProvider.cs
kkeirstead Oct 6, 2023
3645812
Update TimeProvider.cs
kkeirstead Oct 6, 2023
c3c6d4d
Update CollectionRulePipelineState.cs
kkeirstead Oct 6, 2023
bea1cb2
Update CollectionRulePipelineState.cs
kkeirstead Oct 6, 2023
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
49 changes: 49 additions & 0 deletions .github/workflows/check-learning-path-links-anchor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'Check Learning Path Links'
on:
pull_request:
branches: ['main']

permissions:
pull-requests: read

jobs:
check-learning-path-links-anchor:
if: contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)
name: 'Check Learning Path Links Anchor'
runs-on: ubuntu-latest

steps:
- name: Checkout merge
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
path: merge

- name: Checkout head
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
ref: main
path: head

- name: Get base commit for the PR
working-directory: ./merge
run: |
git fetch origin "$GITHUB_BASE_REF"
base_sha=$(git rev-parse "origin/$GITHUB_BASE_REF")
echo "base_sha=$base_sha" >> $GITHUB_ENV
echo "Merging ${GITHUB_SHA} into ${GITHUB_BASE_REF}"

- name: Get learning path files from head
working-directory: ./head/documentation/learningPath
run: |
learning_path_files=$({ grep "**.md$" })
echo "Files to validate: '${learning_path_files}'"
echo "learning_path_files=$(echo ${learning_path_files})" >> $GITHUB_ENV

for file in learning_path_files; do
if grep -qE '^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$' "$file"; then
echo "Found unique identifier in $file"
else
echo "No unique identifier found in $file"
fi
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:
pull_request:
branches: ['main']

permissions:
pull-requests: read

jobs:
check-learning-path-links:
if: contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)
name: 'Check Learning Path Links'
runs-on: ubuntu-latest

steps:
- name: Checkout merge
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
path: merge

- name: Checkout head
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
persist-credentials: false
ref: main
path: head

- name: Get base commit for the PR
working-directory: ./merge
run: |
git fetch origin "$GITHUB_BASE_REF"
base_sha=$(git rev-parse "origin/$GITHUB_BASE_REF")
echo "base_sha=$base_sha" >> $GITHUB_ENV
echo "Merging ${GITHUB_SHA} into ${GITHUB_BASE_REF}"

- name: Get changed files
working-directory: ./merge
run: |
changed_source_files=$(git diff-tree --no-commit-id --name-only -r "$base_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: kkeirstead/LearningPathFileChecks@main
with:
repoURLToSearch: 'https://github.com/dotnet/dotnet-monitor'
learningPathsDirectory: 'documentation/learningPath'
changedFilePaths: ${{ env.updated_files }}
sourceDirectoryName: 'src'

- name: Generate artifacts (Comment)
working-directory: ./merge
run: |
mkdir -p ./learning-path-review
echo -n "${{ steps.check-links.outputs.modifiedFiles }}" > ./learning-path-review/modifiedFiles
echo -n "${{ steps.check-links.outputs.manuallyReview }}" > ./learning-path-review/manuallyReview
echo -n "${{ steps.check-links.outputs.suggestions }}" > ./learning-path-review/suggestions

- name: Upload artifacts (Comment)
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: learning-path-review
path: merge/learning-path-review/
106 changes: 106 additions & 0 deletions .github/workflows/submit-learning-paths-staleness-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: 'Submit Learning Paths Staleness Check'

on:
workflow_run:
workflows: ["Check Learning Path Links"]
types:
- completed

permissions:
contents: write
issues: write
pull-requests: write

jobs:
submit-learning-paths-staleness-check:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write

steps:
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
id: check-user
with:
script: |
await github.rest.repos.checkCollaborator({
owner: context.repo.owner,
repo: context.repo.repo,
username: context.payload.workflow_run.triggering_actor.login
});

- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
persist-credentials: true

# Download the artifact from the workflow that kicked off this one.
# The default artifact download action doesn't support cross-workflow
# artifacts, so use a 3rd party one.
- name: 'Download linting results'
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
workflow: ${{env.workflow_name}}
run_id: ${{github.event.workflow_run.id }}
name: learning-path-review
path: ./learning-path-review

- name: Set Env Vars
run: |
modifiedFiles=$(cat ./learning-path-review/modifiedFiles)
manuallyReview=$(cat ./learning-path-review/manuallyReview)
suggestions=$(cat ./learning-path-review/suggestions)
echo "modifiedFiles=$modifiedFiles" >> $GITHUB_ENV
echo "manuallyReview=$manuallyReview" >> $GITHUB_ENV
echo "suggestions=$suggestions" >> $GITHUB_ENV

- uses: actions/github-script@v6
name: Check For Duplicate Comment
if: ${{ env.modifiedFiles != '' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MODIFIED_FILES: ${{ env.modifiedFiles }}
MANUALLY_REVIEW: ${{ env.manuallyReview }}
SUGGESTIONS: ${{ env.suggestions }}
with:
script: |
modifiedFiles = process.env.MODIFIED_FILES;
manuallyReview = process.env.MANUALLY_REVIEW;
suggestions = process.env.SUGGESTIONS;
comment_body = "### Learning Paths Staleness Check \n\n #### Impacted Paths:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n #### Manually Review:\n\n" + manuallyReview.replaceAll(",", "\n") + "\n\n---------\n\n #### Suggestions:\n\n" + suggestions.replaceAll(",", "\n");

const comments = await github.rest.issues.listComments({
issue_number: context.payload.workflow_run.pull_requests[0].number,
owner: context.repo.owner,
repo: context.repo.repo
})

var commentExists = false;

console.log("Actual comment body:");
console.log(comment_body);
console.log("");

const new_comment_stripped = comment_body.replaceAll(/\s/g,'')

for (const comment of comments.data) {
console.log(comment.body);
const old_comment_stripped = comment.body.replaceAll(/\s/g,'')

if (old_comment_stripped === new_comment_stripped) {
commentExists = true;
console.log("Match!");
}
}

if (!commentExists)
{
github.rest.issues.createComment({
issue_number: context.payload.workflow_run.pull_requests[0].number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment_body
})
}
3 changes: 2 additions & 1 deletion .github/workflows/submit-linter-suggestions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
run: |
echo 'reporter_name=Add Markdown Feedback' >> $GITHUB_ENV
echo 'workflow_name=add-markdown-feedback.yml' >> $GITHUB_ENV

# Download the artifact from the workflow that kicked off this one.
# The default artifact download action doesn't support cross-workflow
# artifacts, so use a 3rd party one.
Expand Down Expand Up @@ -78,7 +79,7 @@ jobs:
-f.diff.strip=1 \
-reporter="github-pr-review" \
-filter-mode="diff_context" \
-fail-on-error="false" \
-fail-on-error="true" \
-level="warning" \
< "./pr-linter/linter.diff"
env:
Expand Down
7 changes: 7 additions & 0 deletions documentation/learningPath/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
### Was this documentation helpful? [Share feedback](https://www.research.net/r/DGDQWXH?src=documentation%2FlearningPath%2Farchitecture)

# Architecture
This is a test of a deleted [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/OutputFormat.cs).

This is a test of a shifted line [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs#L20).

This is a test of a removed line [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs#L1).

This is a test of an ambiguous line [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs#L16).
Loading
Loading