Skip to content

Commit

Permalink
Adding feature for module publication history (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
matebarabas authored Nov 29, 2023
1 parent 6de3366 commit 9c470d3
Show file tree
Hide file tree
Showing 13 changed files with 468 additions and 186 deletions.
33 changes: 27 additions & 6 deletions .github/policies/scheduledSearches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ disabled: false
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: ITA04 - Label issues that have been marked as requiring author feedback but have not had any activity for 4 days.
- description: 'ITA04 - Label issues that have been marked as requiring author feedback but have not had any activity for 4 days.'
frequencies:
- hourly:
hour: 3
Expand All @@ -27,7 +27,7 @@ configuration:
reply: |
@${issueAuthor}, this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
- description: ITA05 - Close issues that have been marked as requiring author feedback but have not had any activity for 3 days.
- description: 'ITA05A - Close issues that have been marked as requiring author feedback but have not had any activity for 3 days, unless it''s been marked with the "Status long term" label.'
frequencies:
- hourly:
hour: 3
Expand All @@ -38,8 +38,6 @@ configuration:
label: 'Needs: Author Feedback :ear:'
- hasLabel:
label: 'Status: No Recent Activity :zzz:'
- isNotLabeledWith:
label: 'Status: Long Term :hourglass_flowing_sand:'
- isNotLabeledWith:
label: 'Needs: Module Owner :mega:'
- noActivitySince:
Expand All @@ -50,7 +48,28 @@ configuration:
@${issueAuthor}, this issue will now be closed, as it has been marked as requiring author feedback but has not had any activity for **7 days**.
- closeIssue

- description: ITA24 - Remind module owner(s) to start or continue working on this module if there was no activity on the Module Proposal issue for more than 3 weeks.
- description: 'ITA05B - Close issues that have been marked as requiring author feedback but have not had any activity for 3 days, unless it''s been marked with the "Status long term" label.'
frequencies:
- hourly:
hour: 3
filters:
- isIssue
- isOpen
- hasLabel:
label: 'Needs: Author Feedback :ear:'
- hasLabel:
label: 'Status: No Recent Activity :zzz:'
- isNotLabeledWith:
label: 'Status: Long Term :hourglass_flowing_sand:'
- noActivitySince:
days: 3
actions:
- addReply:
reply: |
@${issueAuthor}, this issue will now be closed, as it has been marked as requiring author feedback but has not had any activity for **7 days**.
- closeIssue

- description: 'ITA24 - Remind module owner(s) to start or continue working on this module if there was no activity on the Module Proposal issue for more than 3 weeks. "Add Needs: Attention :wave:" label.'
frequencies:
- hourly:
hour: 3
Expand All @@ -66,4 +85,6 @@ configuration:
actions:
- addReply:
reply: |
@${assignees}, this issue has not had any activity in the last **3 weeks**. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.
${assignees}, this issue has not had any activity in the last **3 weeks**. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.
- addLabel:
label: 'Needs: Attention :wave:'
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If an issue/PR has been labelled with "<mark style="background-color:#808080;col

### ITA24

Remind module owner(s) to start or continue working on this module if there was no activity on the Module Proposal issue for more than 3 weeks.
Remind module owner(s) to start or continue working on this module if there was no activity on the Module Proposal issue for more than 3 weeks. Add "<mark style="background-color:#E99695;">Needs: Attention 👋</mark>" label.

<br>

Expand Down
12 changes: 12 additions & 0 deletions docs/content/indexes/bicep/bicep-pattern-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ The following table shows the number of all available, orphaned and planned **Bi

{{< moduleStats language="Bicep" moduleType="Pattern" showLanguage=false showClassification=false >}}

<br>

### Module Publication History

{{< expand "➕ Module Publication History - Module names, status and owners" "expand/collapse" "closed" >}}

{{< moduleHistory header=true csv="/static/module-indexes/BicepPatternModules.csv" language="Bicep" moduleType="pattern" exclude="New Module :new:,Migrate From CARML :rocket:" monthsToShow=9999 >}}

{{< /expand >}}

<br>

### Available modules

{{< expand "➕ Available Modules - Module names, status and owners" "expand/collapse" "open" >}}
Expand Down
10 changes: 10 additions & 0 deletions docs/content/indexes/bicep/bicep-resource-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ The following table shows the number of all available, orphaned and planned **Bi

<br>

### Module Publication History

{{< expand "➕ Module Publication History - Module names, status and owners" "expand/collapse" "closed" >}}

{{< moduleHistory header=true csv="/static/module-indexes/BicepResourceModules.csv" language="Bicep" moduleType="resource" exclude="New Module :new:,Migrate From CARML :rocket:" monthsToShow=9999 >}}

{{< /expand >}}

<br>

### Available modules

{{< expand "➕ Available Modules - Module names, status and owners" "expand/collapse" "open" >}}
Expand Down
10 changes: 10 additions & 0 deletions docs/content/indexes/terraform/tf-pattern-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ The following table shows the number of all available, orphaned and planned **Te

<br>

### Module Publication History

{{< expand "➕ Module Publication History - Module names, status and owners" "expand/collapse" "closed" >}}

{{< moduleHistory header=true csv="/static/module-indexes/TerraformPatternModules.csv" language="Terraform" moduleType="pattern" exclude="New Module :new:,Migrate From CARML :rocket:" monthsToShow=9999 >}}

{{< /expand >}}

<br>

### Available modules

{{< expand "➕ Available Modules - Module names, status and owners" "expand/collapse" "open" >}}
Expand Down
10 changes: 10 additions & 0 deletions docs/content/indexes/terraform/tf-resource-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ The following table shows the number of all available, orphaned and planned **Te

<br>

### Module Publication History

{{< expand "➕ Module Publication History - Module names, status and owners" "expand/collapse" "closed" >}}

{{< moduleHistory header=true csv="/static/module-indexes/TerraformResourceModules.csv" language="Terraform" moduleType="resource" exclude="New Module :new:,Migrate From CARML :rocket:" monthsToShow=9999 >}}

{{< /expand >}}

<br>

### Available modules

{{< expand "➕ Available Modules - Module names, status and owners" "expand/collapse" "open" >}}
Expand Down
206 changes: 206 additions & 0 deletions docs/layouts/shortcodes/moduleHistory.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
{{ $useHeaderRow := .Get "header" }}
{{ $csv := .Get "csv" }}
{{ $file := readFile $csv }}
{{ $rows := $file | transform.Unmarshal (dict "delimiter" ",") }}
{{ $rows = after 1 $rows }}
{{ $useLinks := .Get "useLinks" | default true }}
{{ $language := .Get "language" }}
{{ $moduleType := .Get "moduleType" }}
{{ $exclude := .Get "exclude" }}
{{ $monthsToShow := .Get "monthsToShow" }}
{{ $ProviderNamespaceColumnId := 0 }}
{{ $ResourceTypeColumnId := 0 }}
{{ $ModuleDisplayNameColumnId := 0 }}
{{ $ModuleNameColumnId := 0 }}
{{ $ModuleStatusColumnId := 0 }}
{{ $RepoURLColumnId := 0 }}
{{ $PublicRegistryReferenceColumnId := 0 }}
{{ $TelemetryIdPrefixColumnId := 0 }}
{{ $PrimaryModuleOwnerGHHandleColumnId := 0 }}
{{ $PrimaryModuleOwnerDisplayNameColumnId := 0 }}
{{ $SecondaryModuleOwnerGHHandleColumnId := 0 }}
{{ $SecondaryModuleOwnerDisplayNameColumnId := 0 }}
{{ $ModuleOwnersGHTeamColumnId := 0 }}
{{ $ModuleContributorsGHTeamColumnId := 0 }}
{{ $DescriptionColumnId := 0 }}
{{ $CommentsColumnId := 0 }}
{{ $FirstPublishedInColumnId := 0 }}
{{ $hasModulesAvailable := false }}
{{ $modules := slice }}
{{ $publicationDates := slice }}
{{ $i := 1 }}

{{ if eq $moduleType "resource" }}
{{ $ProviderNamespaceColumnId = 0 }}
{{ $ResourceTypeColumnId = 1 }}
{{ $ModuleDisplayNameColumnId = 2 }}
{{ $ModuleNameColumnId = 3 }}
{{ $ModuleStatusColumnId = 4 }}
{{ $RepoURLColumnId = 5 }}
{{ $PublicRegistryReferenceColumnId = 6 }}
{{ $TelemetryIdPrefixColumnId = 7 }}
{{ $PrimaryModuleOwnerGHHandleColumnId = 8 }}
{{ $PrimaryModuleOwnerDisplayNameColumnId = 9 }}
{{ $SecondaryModuleOwnerGHHandleColumnId = 10 }}
{{ $SecondaryModuleOwnerDisplayNameColumnId = 11 }}
{{ $ModuleOwnersGHTeamColumnId = 12 }}
{{ $ModuleContributorsGHTeamColumnId = 13 }}
{{ $DescriptionColumnId = 14 }}
{{ $CommentsColumnId = 15 }}
{{ $FirstPublishedInColumnId = 16 }}

{{ range $row, $rows }}
{{ $module := dict
"ProviderNamespace" (index $row $ProviderNamespaceColumnId)
"ResourceType" (index $row $ResourceTypeColumnId)
"ModuleDisplayName" (index $row $ModuleDisplayNameColumnId)
"ModuleName" (index $row $ModuleNameColumnId)
"ModuleStatus" (index $row $ModuleStatusColumnId)
"RepoURL" (index $row $RepoURLColumnId)
"PublicRegistryReference" (index $row $PublicRegistryReferenceColumnId)
"TelemetryIdPrefix" (index $row $TelemetryIdPrefixColumnId)
"PrimaryModuleOwnerGHHandle" (index $row $PrimaryModuleOwnerGHHandleColumnId)
"PrimaryModuleOwnerDisplayName" (index $row $PrimaryModuleOwnerDisplayNameColumnId)
"SecondaryModuleOwnerGHHandle" (index $row $SecondaryModuleOwnerGHHandleColumnId)
"SecondaryModuleOwnerDisplayName" (index $row $SecondaryModuleOwnerDisplayNameColumnId)
"ModuleOwnersGHTeam" (index $row $ModuleOwnersGHTeamColumnId)
"ModuleContributorsGHTeam" (index $row $ModuleContributorsGHTeamColumnId)
"Description" (index $row $DescriptionColumnId)
"Comments" (index $row $CommentsColumnId)
"FirstPublishedInColumnId" (index $row $FirstPublishedInColumnId)
}}
{{ $modules = $modules | append $module }}
{{ if and (ne $module.FirstPublishedInColumnId "") (not ( in $publicationDates $module.FirstPublishedInColumnId )) }}
{{ $publicationDates = $publicationDates | append $module.FirstPublishedInColumnId }}
{{ end }}
{{ end }}

{{ else if eq $moduleType "pattern" }}
{{ $ModuleDisplayNameColumnId = 0 }}
{{ $ModuleNameColumnId = 1 }}
{{ $ModuleStatusColumnId = 2 }}
{{ $RepoURLColumnId = 3 }}
{{ $PublicRegistryReferenceColumnId = 4 }}
{{ $TelemetryIdPrefixColumnId = 5 }}
{{ $PrimaryModuleOwnerGHHandleColumnId = 6 }}
{{ $PrimaryModuleOwnerDisplayNameColumnId = 7 }}
{{ $SecondaryModuleOwnerGHHandleColumnId = 8 }}
{{ $SecondaryModuleOwnerDisplayNameColumnId = 9 }}
{{ $ModuleOwnersGHTeamColumnId = 10 }}
{{ $ModuleContributorsGHTeamColumnId = 11 }}
{{ $DescriptionColumnId = 12 }}
{{ $CommentsColumnId = 13 }}
{{ $FirstPublishedInColumnId = 14 }}

{{ range $row, $rows }}
{{ $module := dict
"ModuleDisplayName" (index $row $ModuleDisplayNameColumnId)
"ModuleName" (index $row $ModuleNameColumnId)
"ModuleStatus" (index $row $ModuleStatusColumnId)
"RepoURL" (index $row $RepoURLColumnId)
"PublicRegistryReference" (index $row $PublicRegistryReferenceColumnId)
"TelemetryIdPrefix" (index $row $TelemetryIdPrefixColumnId)
"PrimaryModuleOwnerGHHandle" (index $row $PrimaryModuleOwnerGHHandleColumnId)
"PrimaryModuleOwnerDisplayName" (index $row $PrimaryModuleOwnerDisplayNameColumnId)
"SecondaryModuleOwnerGHHandle" (index $row $SecondaryModuleOwnerGHHandleColumnId)
"SecondaryModuleOwnerDisplayName" (index $row $SecondaryModuleOwnerDisplayNameColumnId)
"ModuleOwnersGHTeam" (index $row $ModuleOwnersGHTeamColumnId)
"ModuleContributorsGHTeam" (index $row $ModuleContributorsGHTeamColumnId)
"Description" (index $row $DescriptionColumnId)
"Comments" (index $row $CommentsColumnId)
"FirstPublishedInColumnId" (index $row $FirstPublishedInColumnId)
}}
{{ $modules = $modules | append $module }}
{{ if and (ne $module.FirstPublishedInColumnId "") (not ( in $publicationDates $module.FirstPublishedInColumnId )) }}
{{ $publicationDates = $publicationDates | append $module.FirstPublishedInColumnId }}
{{ end }}
{{ end }}
{{ else }}
{{ errorf "The %q shortcode requires a moduleType parameter to bet set to either 'resource' or 'pattern'. See %s" .Name .Position }}
{{ end }}

{{ $publicationDates = sort $publicationDates "value" "desc" }}
{{ $publicationDates := first $monthsToShow $publicationDates }}
{{ $modules = sort $modules "ModuleName" }}

{{ if eq $language "Bicep" }}
{{ range $publicationDate, $publicationDates }}
{{ $i = 1 }}
{{ $date := time (printf "%s-01" $publicationDate) }}
{{ $formattedDate := $date.Format "January 2006" }}
{{ printf "### Modules published in %s" $formattedDate | markdownify }}
{{/* {{ printf "**Modules published in %s**" $formattedDate | markdownify }} */}}
<table>
{{ if $useHeaderRow }}
<thead>
<tr>
<th>No.</th>
<th>Module Name</th>
<th>Module Display Name</th>
<th>Module Status</th>
<th>Primary Module Owner<br>GitHub Handle<br>(& Display Name)</th>
</tr>
</thead>
{{ end }}
{{ range $item, $modules }}
{{ if and (eq $item.FirstPublishedInColumnId $publicationDate) (not ( in $exclude $item.ModuleStatus )) }}
<tr>
<td>{{ printf "%02d" $i }}{{ $i = add $i 1 }}</td>
<td>{{ if $useLinks }} {{ if or (eq $item.ModuleStatus "Module Available :green_circle:") (eq $item.ModuleStatus "Module Orphaned :eyes:") }} <a href="{{ $item.RepoURL }}">{{ $item.ModuleName }}</a> {{ else }} {{ $item.ModuleName }} {{ end }} {{else}} {{ $item.ModuleName }} {{ end }} </td>
<td>{{ $item.ModuleDisplayName }}</td>
<td>{{ emojify $item.ModuleStatus }}</td>
<td>{{ if ne $item.PrimaryModuleOwnerGHHandle ""}}<a href="https://github.com/{{ $item.PrimaryModuleOwnerGHHandle }}">{{ $item.PrimaryModuleOwnerGHHandle }}</a> {{ if and (ne $item.PrimaryModuleOwnerGHHandle "") (ne $item.PrimaryModuleOwnerDisplayName "") }} <br> ({{ $item.PrimaryModuleOwnerDisplayName }}) {{ end }} {{ end}}</td>
</tr>
{{ end }}
{{ end }}

</table>
<br>
{{ $hasModulesAvailable = true }}
{{ end }}
{{ else if eq $language "Terraform" }}
{{ range $publicationDate, $publicationDates }}
{{ $i = 1 }}
{{ $date := time (printf "%s-01" $publicationDate) }}
{{ $formattedDate := $date.Format "January 2006" }}
{{ printf "### Modules published in %s" $formattedDate | markdownify }}
{{/* {{ printf "**Modules published in %s**" $formattedDate | markdownify }} */}}
<table>
{{ if $useHeaderRow }}
<thead>
<tr>
<th>No.</th>
<th>Module Name</th>
<th>Source Code</th>
<th>Module Display Name</th>
<th>Module Status</th>
<th>Primary Module Owner<br>GitHub Handle<br>(& Display Name)</th>
</tr>
</thead>
{{ end }}
{{ range $item, $modules }}
{{ if and (eq $item.FirstPublishedInColumnId $publicationDate) (not ( in $exclude $item.ModuleStatus )) }}
<tr>
<td>{{ printf "%02d" $i }}{{ $i = add $i 1 }}</td>
<td>{{ if $useLinks }} {{ if or (eq $item.ModuleStatus "Module Available :green_circle:") (eq $item.ModuleStatus "Module Orphaned :eyes:") }} <a href="{{ $item.PublicRegistryReference }}">{{ $item.ModuleName }}</a> {{ else }} {{ $item.ModuleName }} {{ end }} {{else}} {{ $item.ModuleName }} {{ end }} </td>
<td>{{ if $useLinks }} {{ if or (eq $item.ModuleStatus "Module Available :green_circle:") (eq $item.ModuleStatus "Module Orphaned :eyes:") }} <a href="{{ $item.RepoURL }}">📄</a> {{ else }} {{ "n/a" }} {{ end }} {{else}} {{ "n/a" }} {{ end }} </td>
<td>{{ $item.ModuleDisplayName }}</td>
<td>{{ emojify $item.ModuleStatus }}</td>
<td>{{ if ne $item.PrimaryModuleOwnerGHHandle ""}}<a href="https://github.com/{{ $item.PrimaryModuleOwnerGHHandle }}">{{ $item.PrimaryModuleOwnerGHHandle }}</a> {{ if and (ne $item.PrimaryModuleOwnerGHHandle "") (ne $item.PrimaryModuleOwnerDisplayName "") }} <br> ({{ $item.PrimaryModuleOwnerDisplayName }}) {{ end }} {{ end}}</td>

</tr>
{{ end }}
{{ end }}

</table>
<br>
{{ $hasModulesAvailable = true }}
{{ end }}
{{ else }}
{{ errorf "The %q shortcode requires a language parameter to be set either 'Bicep' or 'Terraform'. See %s" .Name .Position }}
{{ end }}


{{ if not $hasModulesAvailable }}
❌ No module are available yet.
{{ end }}
Loading

0 comments on commit 9c470d3

Please sign in to comment.