-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 28621fc
Showing
35 changed files
with
5,726 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
^renv$ | ||
^renv\.lock$ | ||
_*.new.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source("renv/activate.R") | ||
|
||
# Install commit-hooks locally | ||
statusWriteCommit <- file.copy(".hooks/pre-commit.R", ".git/hooks/pre-commit", overwrite = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Code of Conduct | ||
|
||
As contributors and maintainers of this project, we pledge to follow the [Contributor Covenant](https://www.contributor-covenant.org/) in our interactions with others. We value an open and welcoming environment where everyone feels respected and heard. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
- Being respectful and considerate of differing viewpoints. | ||
- Using welcoming and inclusive language. | ||
- Focusing on what is best for the community. | ||
- Showing empathy towards other community members. | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
- Harassment, trolling, or derogatory comments. | ||
- Personal attacks or insults. | ||
- Any form of discrimination. | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying and enforcing our standards of behavior. They have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned with this Code of Conduct. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and address any reported issues promptly. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: Bug report | ||
about: Tell us about an issue you have found | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Description | ||
|
||
<!-- Briefly describe the issue you encountered. --> | ||
|
||
## Steps to Reproduce | ||
|
||
<!-- | ||
* Describe the steps to reproduce the bug. | ||
* Include any relevant code snippets or screenshots. | ||
--> | ||
|
||
## Expected Behavior | ||
|
||
<!-- Describe what you expected to happen instead. --> | ||
|
||
## Additional Information | ||
|
||
<!-- Include any additional information you can, e.g. | ||
- Operating System | ||
- Browser (if applicable) | ||
- URL you were visiting | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Description | ||
|
||
<!-- Briefly describe the feature you'd like to see. --> | ||
|
||
## Use case | ||
|
||
<!-- | ||
Explain the use case or scenario where this feature would be valuable. | ||
Ideally through a user story, e.g. | ||
As a ... | ||
I want ... | ||
So that ... | ||
--> | ||
|
||
## Why this is important | ||
|
||
<!-- | ||
Describe how this issue affects you and others who may use the project. | ||
What would happen if this issue wasn't resolved? | ||
--> | ||
|
||
## Additional Context | ||
|
||
<!-- | ||
Any additional context or information related to the feature request. | ||
Include any alternative approaches you've considered. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Other issue | ||
about: Template for any other issues relating to this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Description | ||
|
||
<!-- Briefly describe the issue you'd like to like to raise. --> | ||
|
||
## Why this is important | ||
|
||
<!-- | ||
Describe how this issue affects you and others who may use the project. | ||
What would happen if this issue wasn't resolved? | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Overview of changes | ||
|
||
<!-- Briefly describe the purpose of this pull request. --> | ||
|
||
<!-- Add any relevant screenshots or images, including before and after if possible. --> | ||
|
||
<!-- If this PR is related to any existing issues, mention them here (e.g., "Resolves #123"). --> | ||
|
||
## Why are these changes being made? | ||
|
||
<!-- Explicitly state the reason for the pull request --> | ||
|
||
## Checklist | ||
|
||
<!-- Put 'x' in the checkboxes that you have completed to help your reviewer --> | ||
|
||
- [ ] I have tested these changes locally using `shinytest2::test_app()` | ||
- [ ] I have ran `styler::style_dir()` | ||
- [ ] I have ran `lintr::lint_dir()` | ||
- [ ] I have updated the documentation | ||
- [ ] I have added or updated automated tests for these changes | ||
|
||
## Reviewer instructions | ||
|
||
<!-- Put any specific questions or instructions for reviewers in here --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Security Policy | ||
|
||
## Reporting Security Issues | ||
|
||
If you find a security vulnerability, please: | ||
|
||
1. Avoid sharing the issue publicly until it is fixed. | ||
|
||
2. [Report the vulnerability privately via GitHub](https://github.com/dfe-analytical-services/explore-education-statistics-analytics/security/advisories/new). | ||
<!-- update the link above to relate to the repository it is used in --> | ||
|
||
3. Include a description, steps to reproduce, and affected versions. | ||
|
||
4. We will acknowledge your report as soon as practicable. | ||
|
||
## Supported Versions | ||
|
||
Only the latest stable release is actively maintained. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
|
||
name: Dashboard tests | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
automatedTests: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- name: Install git2r dependencies | ||
run: sudo apt-get install -y libgit2-dev | ||
|
||
- name: Cache renv packages | ||
id: cache-renv | ||
uses: actions/cache@v4 | ||
with: | ||
path: screener-renv-cache | ||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-renv- | ||
- uses: r-lib/actions/setup-renv@v2 | ||
|
||
- name: Run tests | ||
shell: Rscript {0} | ||
run: | | ||
shinytest2::test_app("analytics-dashboard") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '20 3 * * 0' | ||
|
||
name: lintr | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lintr: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: Run lintr scanning | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: ubuntu-latest, r: 'release'} | ||
|
||
permissions: | ||
contents: read # for checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- name: restore renv | ||
uses: r-lib/actions/setup-renv@v2 | ||
|
||
- name: Install lintr | ||
shell: Rscript {0} | ||
run: | | ||
renv::install("lintr") | ||
- name: Run lintr | ||
run: lintr::sarif_output(lintr::lint_dir("."), "lintr-results.sarif") | ||
shell: Rscript {0} | ||
continue-on-error: true | ||
|
||
- name: Upload analysis results to GitHub | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: lintr-results.sarif | ||
wait-for-processing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# {shinytest2}: Ignore new debug snapshots for `$expect_values()` | ||
*_.new.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env Rscript | ||
message("\nRunning commit hooks...") | ||
|
||
message("\n") | ||
|
||
message("1. Checking code styling...\n") | ||
style_output <- eval(styler::style_dir()$changed) | ||
if (any(style_output)) { | ||
message("Warning: Code failed styling checks. | ||
\n`styler::style_dir()` has been run for you. | ||
\nPlease check your files and dashboard still work. | ||
\nThen re-stage and try committing again.") | ||
quit(save = "no", status = 1, runLast = FALSE) | ||
} else { | ||
message("...code styling checks passed") | ||
} | ||
|
||
message("\n") | ||
message("\n2. Rebuilding manifest.json...") | ||
if (system.file(package = "git2r") == "") { | ||
renv::install("git2r") | ||
} | ||
if (system.file(package = "rsconnect") != "" & system.file(package = "git2r") != "") { | ||
if (!any(grepl("manifest.json", git2r::status()))) { | ||
rsconnect::writeManifest(paste0(getwd(), "/analytics-dashboard")) | ||
git2r::add(path = "analytics-dashboard/manifest.json") | ||
} | ||
message("...manifest.json rebuilt\n") | ||
} else { | ||
if (system.file(package = "rsconnect") == "") { | ||
message("rsconnect is not installed") | ||
} | ||
if (system.file(package = "git2r") == "") { | ||
message("git2r is not installed") | ||
} | ||
message("...this step has been skipped") | ||
} | ||
|
||
message("\n") | ||
|
||
# End of hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
linters: linters_with_defaults( | ||
line_length_linter(120), | ||
object_usage_linter = NULL | ||
) | ||
exclusions: list( | ||
"adhoc-scripts/", | ||
"data-updates/events-data.R" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2025 DfE Analytical Services | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.