Skip to content

DEMO — New filterable breaking changes & deprecations page #652

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

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6bfc97a
Adding a breaking changes page
validbeck Feb 6, 2025
585b976
Details
validbeck Feb 6, 2025
4eeea0e
Editing headers
validbeck Feb 6, 2025
54ebd25
Adding product area
validbeck Feb 6, 2025
f2d4d6d
Folder
validbeck Feb 6, 2025
71c3e96
Testing R table
validbeck Feb 6, 2025
65470d4
It woooorks
validbeck Feb 6, 2025
4dd58a7
Setup for multiple entires & adding search back
validbeck Feb 6, 2025
8f59e3c
Adjusting test data for clarity
validbeck Feb 6, 2025
cbc4897
Single-sourcing the functions
validbeck Feb 6, 2025
f3fde95
Moving functions to scri[pt for cleaner exp
validbeck Feb 6, 2025
21cd9d8
Column widths back in
validbeck Feb 6, 2025
099b7d6
Cleanup & templates
validbeck Feb 6, 2025
45870ec
Templating README
validbeck Feb 6, 2025
94656bd
Tweaking
validbeck Feb 6, 2025
51397c8
Adding version and type columns
validbeck Feb 7, 2025
c2c8e82
Filters for version & type
validbeck Feb 7, 2025
339cc78
Examples and more testing
validbeck Feb 7, 2025
4f3b8f4
Intro to README
validbeck Feb 7, 2025
a87fe73
Moved history into its own folder
validbeck Feb 7, 2025
5dd78f0
Instructions for +year
validbeck Feb 7, 2025
f542772
Add an entry draft
validbeck Feb 7, 2025
36c847e
Entry example table
validbeck Feb 7, 2025
5e26850
Testing R setup
validbeck Feb 7, 2025
41a0d21
Switching placement
validbeck Feb 7, 2025
c36fd4f
Forgot a package
validbeck Feb 7, 2025
0ac4cc7
Cleanup & caching
validbeck Feb 7, 2025
509dd0c
Forgot a package again
validbeck Feb 7, 2025
85d7cb6
Adding R env to staging & prod flows
validbeck Feb 7, 2025
3aa9ae6
Naming the code cells for output cleanliness
validbeck Feb 7, 2025
5a3316b
Removed fake 2025 example
validbeck Feb 7, 2025
bfb00a6
Wow, typo
validbeck Feb 7, 2025
bf25932
Wording adjustment
validbeck Feb 7, 2025
2b8f18d
Removed blog posts
validbeck Feb 10, 2025
554998b
Updated demo
validbeck Feb 10, 2025
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
33 changes: 33 additions & 0 deletions .github/actions/setup-r/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Setup R and install packages"
description: "Sets up R and installs required packages for displaying interactive tables from .CSV"
runs:
using: "composite"
steps:
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.3'

- name: Cache R packages
uses: actions/cache@v3
with:
path: ${{ runner.os == 'Linux' && '/home/runner/work/_temp/Library' || runner.os == 'macOS' && '~/Library/R/4.3/library' }}
key: r-packages-${{ runner.os }}-${{ hashFiles('**/DESCRIPTION', '**/renv.lock') }}
restore-keys: |
r-packages-${{ runner.os }}-

- name: Install R packages
shell: bash
run: |
Rscript -e 'install.packages(c("DT", "readr", "stringr", "lubridate"), repos="https://cran.rstudio.com/")'

- name: Verify R installation
shell: bash
run: |
Rscript -e 'sessionInfo()'
which R

- name: Verify Quarto detects R
shell: bash
run: |
quarto check
3 changes: 3 additions & 0 deletions .github/workflows/deploy-docs-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:

- name: Fetch Quarto
uses: ./.github/actions/fetch-quarto

- name: Setup R environment
uses: ./.github/actions/setup-r

- name: Render prod docs site
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-docs-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:

- name: Fetch Quarto
uses: ./.github/actions/fetch-quarto

- name: Setup R environment
uses: ./.github/actions/setup-r

- name: Render staging docs site
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/validate-docs-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: Fetch Quarto
uses: ./.github/actions/fetch-quarto

- name: Setup R environment
uses: ./.github/actions/setup-r

- name: Render demo docs site
run: |
cd site
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ You need:
- The Quarto extension for your IDE, such as [VS Code](https://marketplace.visualstudio.com/items?itemName=quarto.quarto)
- For Windows operating systems, install the `make` command via [Cygwin](https://cygwin.com/install.html)

### Additional dependencies

Some interactive tables, such as our breaking changes and dependency history rely you have R and some R packages installed in order for you to be able to preview or render certain pages of the docs site locally.

**Refer to the [Breaking changes and deprecations](site/releases/breaking-changes/README.md) guide** for more information on how to install R and set up these tables.

## How to contribute

> [!IMPORTANT]
Expand Down
2 changes: 2 additions & 0 deletions site/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ website:
- releases/2023/release-notes-2023-jul-24.qmd
- releases/2023/release-notes-2023-jun-22.qmd
- releases/2023/release-notes-2023-may-30.qmd
- text: "Breaking changes & deprecations"
file: releases/breaking-changes/breaking-changes.qmd
- text: "---"
- text: "Fine Print"
- about/fine-print/data-privacy-policy.qmd
Expand Down
95 changes: 95 additions & 0 deletions site/releases/breaking-changes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Breaking changes and deprecations

This guide walks you through how to add a breaking change or deprecation to our [~/releases/breaking-changes/breaking-changes.qmd](breaking-changes.qmd) history.

## Before you begin

In order to get Quarto display the neat interactive table in our HTML output, you need to have R and some dependencies installed in your environment.

### Install R

1. **Download and install R** from the Comprehensive R Archive Network: [CRAN](https://cran.r-project.org/index.html)
- If you're using VS Code, you may also want to install the following extensions: [R](https://marketplace.visualstudio.com/items?itemName=REditorSupport.r), [R Extension Pack](https://marketplace.visualstudio.com/items?itemName=Ikuyadeu.r-pack)
2. **Open up an R terminal.** In VS Code you can press `CTRL/CMD + SHIFT + P` to open up the command palette, then type in and select `R: Create R Terminal`.

### Install R dependencies

In the R terminal, run:

```bash
install.packages("DT")
install.packages("readr")
install.packages("stringr")
install.packages("lubridate")
```

These are the packages used to generate cool interactive tables from the yearly CSVs:

- **[DataTables](https://rstudio.github.io/DT/)** — Displays a R data object as an HTML table.
- **[readr](https://readr.tidyverse.org/)** — Parses the yearly `.csv` files for the table.
- **[stringr](https://readr.tidyverse.org/)** — Parses markdown links in the `.csv` and turns them into HTML for the output table so they can be displayed properly.
- **[lubridate](https://lubridate.tidyverse.org/)** — Parses and reformats the ISO 8601 date in the CSV into the Mon DD, YYYY format in the output table.

## Creating entries

### Add a year

If you're adding the first entry for that year, you'll need to add that year to the history section first:

#### Create the yearly CSV

Make a copy of `~/releases/breaking-changes/year.csv` in the `~/releases/breaking-changes/history/` directory. For example:

> `~/releases/breaking-changes/year.csv` > `~/releases/breaking-changes/history/2025.csv`

> [!CAUTION]
> Due to the way DataTables processes the input, there needs to be an empty row/line break at the end of the sheet.

#### Insert CSV as table

1. In `~/releases/breaking-changes/breaking-changes.qmd` under `<!-- CURRENT YEAR START -->`, insert the new year `h3` header. For example:

```markdown
### 2025
```

2. Then under that header, call the functions to display the interactive table for that year under a named and fenced `{r}` code block. For example:

```R
```{r 2025}
## Render 2025.csv
my_data_2025 <- read_csv_data(2025)
my_data_2025 <- convert_markdown_links(my_data_2025)
my_data_2025 <- format_dates_in_data(my_data_2025)
render_table(my_data_2025)
```
```

Replace the year with the actual year you're intending to display.

### Add an entry

#### Create collateral

You'll need the links for the release notes and any blog posts associated with the breaking change or deprecation to include in the table, so make sure those are published that first unless you want to fill them in at a later date.

#### Enter an entry

Open up the `.csv` for the year you want to update and create a new entry under the header row with the following information:

| Column name | Content | Example |
|---|---|---|
| Change | Name of the feature being broken or deprecated | `Standard inputs are deprecated` |
| Product area | Applicable variable for the ValidMind Library or ValidMind Platform | `{{< var validmind.developer >}} `|
| Version | Associated library or platform version attached to the announcement prefaced by a `v` (Linked to release tags) | `v1.25.3` |
| Type | Whether it's a breaking change or deprecation | `Deprecation` |
| Date announced | ISO 8601 date of announcement | `2024-01-26` |
| Release notes | Markdown format **HTML** link to the associated release notes enclosed by `""` | `"[Read](/releases/2024/2024-jan-26/highlights.html#standard-inputs-are-deprecated)"` |
| Blog post | Markdown format link to the associated blog post enclosed by `""` | `"[Read](https://validmind.com/blog/)"` |
| Date effective | ISO 8601 date of feature removal/deprecation | `2024-01-26` |

> [!NOTE]
> You can refer to the **[example `.csv`](example.csv)** for formatting guidance.
>
> If you're using VS Code, [Excel Viewer](https://marketplace.visualstudio.com/items?itemName=GrapeCity.gc-excelviewer) is a great extension to make editing `.csv` files more accessible.

46 changes: 46 additions & 0 deletions site/releases/breaking-changes/breaking-changes.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "Breaking changes and deprecations"
date: last-modified
# DON'T DISPLAY THE SOURCE CODE FOR THE TABLES ON THE PAGE
execute:
echo: false
---

```{r import-script}
# Import custom `breaking_changes` script
source("breaking_changes.R")
```

## Definitions

deprecation
: - Feature not recommended for use.
- May be removed in a future major release.

breaking change
: - Feature will be removed in a future major release.
- Requires users to make a corresponding change to their code, settings, or workflows.

## History

<!-- CURRENT YEAR START -->

### 2025

```{r 2025}
## Render 2025.csv
my_data_2025 <- read_csv_data(2025)
my_data_2025 <- convert_markdown_links(my_data_2025)
my_data_2025 <- format_dates_in_data(my_data_2025)
render_table(my_data_2025)
```

### 2024

```{r 2024}
## Render 2024.csv
my_data_2024 <- read_csv_data(2024)
my_data_2024 <- convert_markdown_links(my_data_2024)
my_data_2024 <- format_dates_in_data(my_data_2024)
render_table(my_data_2024)
```
71 changes: 71 additions & 0 deletions site/releases/breaking-changes/breaking_changes.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Load necessary libraries with output messages supressed
suppressPackageStartupMessages(library(DT))
suppressPackageStartupMessages(library(readr))
suppressPackageStartupMessages(library(stringr))
suppressPackageStartupMessages(library(lubridate))

# Read CSV while preserving column names and treating all text as characters
read_csv_data <- function(year) {
file_name <- paste0("history/", year, ".csv")
data <- read.csv(file_name, check.names = FALSE, stringsAsFactors = FALSE)
return(data)
}

# Cnvert Markdown-style links to proper HTML
convert_markdown_links <- function(data) {
data[] <- lapply(data, function(column) {
column <- str_replace_all(column, "\\[(.*?)\\]\\((.*?)\\)", "<a href='\\2'>\\1</a>")
return(column)
})
return(data)
}

# Reformat ISO dates to Mon DD, YYYY
format_date <- function(date_column) {
parsed_dates <- ymd(date_column)
formatted_dates <- format(parsed_dates, "%b %d, %Y")
return(formatted_dates)
}

# Apply date formatting to `Date announced` and `Date effective` columns
format_dates_in_data <- function(data) {
if ("Date announced" %in% names(data)) {
data[["Date announced"]] <- format_date(data[["Date announced"]])
}
if ("Date effective" %in% names(data)) {
data[["Date effective"]] <- paste0(
"<span style='color: #92130cff;'>", format_date(data[["Date effective"]]), "</span>"
)
}
return(data)
}

# Render an interactive searchable and filterable table
render_table <- function(data) {
datatable(
data,
options = list(
pageLength = 10, # Define default length of entries
dom = 'fltpi', # Table display options: Search/filter, length menu, the table istself, pagination, table info
initComplete = JS( # Filter `Product area`, `Version`, & `Type` using JavaScript
"function(settings, json) {
[1, 2, 3].forEach(function(index) {
var column = this.api().column(index);
var header = $(column.header()); // Keep original header text
var select = $('<br><select><option value=\"\">All</option></select>')
.appendTo(header) // Append instead of replacing
.on('change', function() {
var val = $.fn.dataTable.util.escapeRegex($(this).val());
column.search(val ? '^' + val + '$' : '', true, false).draw();
});
column.data().unique().sort().each(function(d, j) {
select.append('<option value=\"'+d+'\">'+d+'</option>')
});
}.bind(this));
}"
)
),
escape = FALSE, # Allow HTML rendering
rownames = FALSE # Disable row numbering
)
}
6 changes: 6 additions & 0 deletions site/releases/breaking-changes/example.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change,Product area,Version,Type,Date announced,Release notes,Date effective
ValidMind Library deprecation,{{< var validmind.developer >}},v00.0,Deprecation,YYYY-MM-DD,"[Read](url.html)",YYYY-MM-DD
ValidMind Platform breaking change,{{< var validmind.platform >}},v00.0,Breaking change,YYYY-MM-DD,"[Read](url.html)","YYYY-MM-DD



7 changes: 7 additions & 0 deletions site/releases/breaking-changes/history/2024.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Change,Product area,Version,Type,Date announced,Release notes,Date effective
Standard inputs are deprecated,{{< var validmind.developer >}},v1.25.3,Deprecation,2024-01-26,"[Read](/releases/2024/2024-jan-26/highlights.html#standard-inputs-are-deprecated)",2024-01-26
Removed deprecated Python Library API methods,{{< var validmind.developer >}},v1.25.3,Breaking change,2024-01-26,"[Read](/releases/2024/2024-jan-26/highlights.html#removed-deprecated-methods)",2024-01-26




4 changes: 4 additions & 0 deletions site/releases/breaking-changes/history/2025.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Change,Product area,Version,Type,Date announced,Release notes,Date effective
We deleted the library,{{< var validmind.developer >}},v1.25.3,Deprecation,2025-01-26,"[Read]()",2025-01-26
The platform now rickrolls you,{{< var validmind.platform >}},v1.26.0,Breaking change,2025-04-21,"[Read]()",2025-05-21
Library is now just cat memes,{{< var validmind.platform >}},v1.26.1,Breaking change,2025-11-26,"[Read]()",2025-12-26
6 changes: 6 additions & 0 deletions site/releases/breaking-changes/year.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change,Product area,Version,Type,Date announced,Release notes,,Date effective
ValidMind Library deprecation,{{< var validmind.developer >}},v00.0,Deprecation,YYYY-MM-DD,"[Read](url.html)",YYYY-MM-DD
ValidMind Platform breaking change,{{< var validmind.platform >}},v00.0,Breaking change,YYYY-MM-DD,"[Read](url.html)",YYYY-MM-DD



Loading