Skip to content

Commit

Permalink
Merge branch 'main' into alasql_data_type_improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
pm0kjp authored Mar 29, 2024
2 parents bcc086d + d5fb2a4 commit 41a49d5
Show file tree
Hide file tree
Showing 41 changed files with 1,137 additions and 55 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/alt_text.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
grep -rn --include=\*.md "\!\[\s*\]" | # search for lines with "![]" empty alt tag, only in markdown files
grep -v "ISSUE_TEMPLATE" > issues #return only lines in files that are NOT in the issue template folder
#bc QA issue templates include example code block showing empty tag for illustration

if [[ -s issues ]] # if file size > 0, ie there are issues with any of the markdown files
then
echo "File paths + lines with missing alt text"
cat issues # for end user clarity on what needs to be fixed in each file -- when fails, they can go look at output to see what the issue is.
false
fi
38 changes: 38 additions & 0 deletions .github/scripts/check_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
awk 'BEGIN { RS = "diff --git" } # splits diff file such that each file represented in the diff is treated as an individual record. each record is processed individually with the below statements
{
if (system("bash .github/scripts/is_module.sh " $1 " || bash .github/scripts/is_docs_or_macros.sh " $1 ) == 0)
{
if ( $0 ~ /\/dev\/null/ ) # is this a module file being uploaded for the first time?
{
version_line_index=match ($0, /\+version:[^\n]+/) # gets the starting index of where the pattern is matched, sets RSTART to that value, and RLENGTH to the length of pattern match.
extracted_version_line=substr($0, RSTART, RLENGTH) # pulls out the substring that matches.
system( "version_number=$(echo " extracted_version_line " | tr -d \"\\+version:\"); if [ $version_number != \"1.0.0\" ]; then echo \"New module "$1" version number needs to be 1.0.0\" >> version_issues ; fi " )
# trims the extracted version line to now just contain the version number itself. Checks if it is equal to 1.0.0, and adds message to list of issues if not.
}
else if ( $0 ~ /\+version:/) # is there a new version line?
{
version_line_index=match ($0, /(-version:.*\+version:[^\n]+)/) # gets the starting index of where the pattern is matched, sets RSTART to that value
# regex used above accounts for the fact that there may be other lines displayed in the diff in between old and new version lines
extracted_version_lines=substr($0,RSTART,RLENGTH) # pulls out the substring that matches.
system("bash -c '\''issue=$(grep \"[+-]version:\" <<< \""extracted_version_lines "\"| sed \"s/[+-]version://g\"| bash .github/scripts/version_values_comparison.sh); if [ -n \"$issue\" ]; then echo \""$1": $issue\" >> version_issues ; fi'\''")
# removes any extra lines from diff by grepping for only lines with +/- version, then trims the line to just contain version number itself. if issue string is not null (ie, value comparison script returns issue messages), adds messages to list of issues.
}
else
{
print $1 " does not have an updated version number" >> "version_issues"
}
}
else
{
#do nothing, as only modules need to be checked for version number incrementation.
}
} ' "$1"

if [[ -s version_issues ]] # if file size > 0, ie there are issues with any of the modules
then
echo "Issues with version numbers:"
cat version_issues # for end user clarity on what needs to be fixed in each module -- when fails, they can go look at output to see what the issue is.
false
fi
1 change: 1 addition & 0 deletions .github/scripts/is_docs_or_macros.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep -q -P "(macros.*|docs)\.md$" <<< "$1" # checks for docs.md and any files matching the macro naming pattern.
1 change: 1 addition & 0 deletions .github/scripts/is_module.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grep -q -P "([^\/]+)\/\1.md" <<< "$1" # checks for the module naming pattern.
54 changes: 54 additions & 0 deletions .github/scripts/version_values_comparison.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
awk -F "." 'BEGIN {FS="\\.|\n."; RS = "\n\n" }
{
if ( NF != 6 ) # if more or less than 6 fields are parsed, that means there is something wrong either with the formatting of the version numbers, or there is more than one version line being added to the module.
{
print "There is something unexpected happening with the version numbers. Ensure that the current version of the file only has one version field listed in the header, and that the appropriate number structure is followed."
}
else
{
if ( $1 == $4 ) #if old major = new major
{
if ($2==$5) # if old minor = new minor
{
if ( $3==$6) # old revision = new revision
{
print "The version numbers are identical. Appropriately increment the number" # realistically, shouldnt ever actually happen unless the only edit is to add or remove whitespace.
}
else
{
if ( $3+1==$6) # old revision plus one = new revision
{
# do nothing
}
else
{
print "Revision does not equal old revision plus one. Please review the versioning guidelines and update this module accordingly. "
}
}
}
else
{
if ( $2+1==$5 && $6 == 0 )
{
#do nothing
}
else
{
print "Seems like minor was not incremented by just one, or revision was not set back to zero. Please review the versioning guidelines and update this module accordingly."
}
}
}
else
{
if ($1+1==$4 && $5 == 0 && $6 == 0)
{
#do nothing
}
else
{
print "Major either changed by something other than one, or the other numbers did not reset to zero. Please review the versioning guidelines and update this module accordingly."
}
}
}
} '
13 changes: 13 additions & 0 deletions .github/workflows/alt_text.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Missing alt text
on:
pull_request:
branches: [ "main" ]
types: [opened, synchronize]

jobs:
check-alt-text:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check markdown for alt text presence
run: bash .github/scripts/alt_text.sh
20 changes: 10 additions & 10 deletions .github/workflows/pull_metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:
# outputs:
# changes: ${{ steps.check_if_changed.outputs.changes }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# Process all the metadata using the script for that
- name: Process Metadata
run: |
bash .github/scripts/process_metadata.sh
- name: Upload json file as an artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: json_artifact
path: module_data.json
Expand All @@ -49,7 +49,7 @@ jobs:
changes: ${{ steps.check_if_changed.outputs.changes }}
steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: json_artifact

Expand Down Expand Up @@ -104,10 +104,10 @@ jobs:
OUTPUT3: ${{needs.run_script.outputs.changes}}
run: echo "The changes variable is $OUTPUT3"

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download json artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: json_artifact

Expand Down Expand Up @@ -154,14 +154,14 @@ jobs:
runs-on: ubuntu-latest
needs: metadata_changed_message
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build webpage markdown file
run: |
bash .github/scripts/public_list_of_modules.sh
- name: Upload webpage file as an artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: webpage_artifact
path: new_list_of_modules.md
Expand All @@ -176,7 +176,7 @@ jobs:
changes: ${{ steps.check_if_website_changed.outputs.changes }}
steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: webpage_artifact

Expand Down Expand Up @@ -214,10 +214,10 @@ jobs:
needs: check_list_of_modules_for_changes
if: needs.check_list_of_modules_for_changes.outputs.changes == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download webpage artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: webpage_artifact

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/version_incrementation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check modules in PR for version incrementation
on:
pull_request:
branches: [ "main" ]
types: [opened, synchronize]

jobs:
check-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get git diff to feed to script
run: |
git fetch origin main
git diff origin/main HEAD > git_diff.txt
- name: check git diff
run: cat git_diff.txt
- name: Check version numbers
run: bash .github/scripts/check_versions.sh git_diff.txt
13 changes: 10 additions & 3 deletions _module_templates/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
author: DART Team
email: dart@chop.edu
version: 1.3.0
current_version_description: Add module\_id to macros for creating the REDCap survey link
version: 1.4.0
current_version_description: Add text after Overview and Feedback that invites learners to the rest of the modules
language: en
narrator: UK English Female
title: Module Macros
Expand All @@ -13,9 +13,9 @@ comment: This is placeholder module to save macros used in other modules.
Previous versions:
- [1.3.0](https://liascript.github.io/course/?https://raw.githubusercontent.com/arcus/education_modules/bbd9189b6c598c77059da184995c83b4037cbd73/_module_templates/macros.md#1) :Add module\_id to macros for creating the REDCap survey link
- [1.2.1](https://liascript.github.io/course/?https://raw.githubusercontent.com/arcus/education_modules/a9aa1b38fc51db4252c9547654d9e36dba7864e5/_module_templates/macros.md#1): make CSS come from GCS
- [1.1.0](https://liascript.github.io/course/?https://raw.githubusercontent.com/arcus/education_modules/ad25398d0eef884402cff0f0c4fb4ca360d3b8f4/_module_templates/macros.md#1): Add current\_version\_description and version\_history metadata.
- [1.0.0](https://liascript.github.io/course/?https://raw.githubusercontent.com/arcus/education_modules/e983922162e6fbf971c03dc96052f68713cc72af/_module_templates/macros.md#1): Initial version
@end
Expand Down Expand Up @@ -44,6 +44,9 @@ This version (@version): @current_version_description
@version_history
</div>
Looking for other modules on this topic or other topics related to data analytics and data science in biomedicine? Please see [our complete list of educational modules](https://arcus.github.io/education_modules/list_of_modules) or consider trying our [prototype curriculum builder](https://learn.arcus.chop.edu).
@end
@make_survey_url
Expand Down Expand Up @@ -77,6 +80,9 @@ We ask you to fill out a brief (5 minutes or less) survey to let us know:
* If we gave you the experience you expected
We gather this information in order to iteratively improve our work. Thank you in advance for filling out @make_survey_url('@title', '@version', '@module_type', '@module_id')!
Looking for other modules on this topic or other topics related to data analytics and data science in biomedicine? Please see [our complete list of educational modules](https://arcus.github.io/education_modules/list_of_modules) or consider trying our [prototype curriculum builder](https://learn.arcus.chop.edu).
@end
Expand Down Expand Up @@ -142,4 +148,5 @@ script: https://code.jquery.com/jquery-3.6.0.slim.min.js
@overview

## Feedback

@feedback
4 changes: 3 additions & 1 deletion bash_103_combining_commands/bash_103_combining_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module_id: bash_103_combining_commands
author: Elizabeth Drellich and Nicole Feldman
email: drelliche@chop.edu and feldmanna@chop.edu
version: 1.4.2
version: 1.4.3
current_version_description: Added webinar links to additional resources
module_type: standard
docs_version: 2.0.0
Expand Down Expand Up @@ -42,6 +42,8 @@ previous_sequential_module: bash_command_line_102
@end
@depends_on_knowledge_available_in
- directories_and_file_paths
- demystifying_command_line
- bash_command_line_101
- bash_command_line_102
@end
Expand Down
5 changes: 3 additions & 2 deletions bash_command_line_101/bash_command_line_101.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module_id: bash_command_line_101
author: Nicole Feldman and Elizabeth Drellich
email: feldmanna@chop.edu drelliche@chop.edu
version: 1.5.4
version: 1.5.5
current_version_description: Updated metadata and macros
module_type: standard
docs_version: 2.0.0
Expand All @@ -17,7 +17,7 @@ long_description: This course is designed to be both an introduction to bash / c
estimated_time_in_minutes: 40
@pre_reqs
Learners should be familiar with locating files and folders stored in a directory system. Our [Directories and File Paths](https://liascript.github.io/course/?https://raw.githubusercontent.com/arcus/education_modules/main/directories_and_file_paths/directories_and_file_paths.md#1) module can provide some help with gaining these skills.
Learners should be familiar with [the command line interface](https://liascript.github.io/course/?https://raw.githubusercontent.com/arcus/education_modules/main/demystifying_command_line/demystifying_command_line.md#1) and [locating files and folders stored in a directory system](https://liascript.github.io/course/?https://raw.githubusercontent.com/arcus/education_modules/main/directories_and_file_paths/directories_and_file_paths.md#1).
@end
@learning_objectives
Expand All @@ -40,6 +40,7 @@ sequence_name: bash_basics
@end
@depends_on_knowledge_available_in
- demystifying_command_line
- directories_and_file_paths
@end
Expand Down
9 changes: 6 additions & 3 deletions bash_command_line_102/bash_command_line_102.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
module_id: bash_command_line_102
author: Nicole Feldman and Elizabeth Drellich
email: feldmanna@chop.edu and drelliche@chop.edu
version: 1.3.1
current_version_description: Add emphasis about he permanence of `rm`
version: 1.3.2
current_version_description: Add emphasis about the permanence of `rm`
module_type: standard
docs_version: 3.0.0
language: en
Expand Down Expand Up @@ -47,10 +47,13 @@ previous_sequential_module: bash_command_line_101
@sets_you_up_for
- bash_103_combining_commands
- bash_conditionals_loops
- bash_scripts
@end
@depends_on_knowledge_available_in
-bash_command_line_101
- directories_and_file_paths
- demystifying_command_line
- bash_command_line_101
@end
@version_history
Expand Down
5 changes: 3 additions & 2 deletions bash_conditionals_loops/bash_conditionals_loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module_id: bash_conditionals_loops
author: Elizabeth Drellich
email: drelliche@chop.edu
version: 1.2.4
version: 1.2.5
current_version_description: Clarify `=` and `==` inside test functions
module_type: standard
docs_version: 1.2.1
Expand Down Expand Up @@ -50,7 +50,8 @@ previous_sequential_module: bash_103_combining_commands
@end
@depends_on_knowledge_available_in
- directories_and_file_paths
- demystifying_command_line
- bash_command_line_101
- bash_command_line_102
Expand Down
6 changes: 4 additions & 2 deletions bash_scripts/bash_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module_id: bash_scripts
author: Elizabeth Drellich
email: drelliche@chop.edu
version: 1.3.2
version: 1.3.3
current_version_description: Added webinar links to additional resources
module_type: standard
docs_version: 2.0.0
Expand Down Expand Up @@ -49,7 +49,9 @@ previous_sequential_module: bash_conditionals_loops
@end
@depends_on_knowledge_available_in
- directories_and_file_paths
- demystifying_command_line
- bash_command_line_101
- bash_command_line_102
- bash_103_combining_commands
- bash_conditionals_loops
Expand Down
Loading

0 comments on commit 41a49d5

Please sign in to comment.