Merge branch 'master' into fix-lefthook-patterns

fix-lefthook-patterns
Jason Stirnaman 2025-06-06 17:27:26 -05:00 committed by GitHub
commit 78857d8c87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 72 additions and 42 deletions

View File

@ -5,13 +5,13 @@
* release notes pages. * release notes pages.
*/ */
// Use jQuery filter to get an array of all the *release* h2 elements // Get all h2 elements that are not checkpoint-releases
const releases = $('h2').filter( const releases = Array.from(document.querySelectorAll('h2')).filter(
(_i, el) => !el.id.match(/checkpoint-releases/) el => !el.id.match(/checkpoint-releases/)
); );
// Extract data about each release from the array of releases // Extract data about each release from the array of releases
releaseData = releases.map((_i, el) => ({ const releaseData = releases.map(el => ({
name: el.textContent, name: el.textContent,
id: el.id, id: el.id,
class: el.getAttribute('class'), class: el.getAttribute('class'),
@ -19,8 +19,8 @@ releaseData = releases.map((_i, el) => ({
})); }));
// Use release data to generate a list item for each release // Use release data to generate a list item for each release
getReleaseItem = (releaseData) => { function getReleaseItem(releaseData) {
var li = document.createElement("li"); const li = document.createElement("li");
if (releaseData.class !== null) { if (releaseData.class !== null) {
li.className = releaseData.class; li.className = releaseData.class;
} }
@ -29,9 +29,10 @@ getReleaseItem = (releaseData) => {
return li; return li;
} }
// Use jQuery each to build the release table of contents // Build the release table of contents
releaseData.each((_i, release) => { const releaseTocUl = document.querySelector('#release-toc ul');
$('#release-toc ul')[0].appendChild(getReleaseItem(release)); releaseData.forEach(release => {
releaseTocUl.appendChild(getReleaseItem(release));
}); });
/* /*
@ -39,20 +40,30 @@ releaseData.each((_i, release) => {
* number specified in the `show` attribute of `ul.release-list`. * number specified in the `show` attribute of `ul.release-list`.
* Once all the release items are visible, the "Show More" button is hidden. * Once all the release items are visible, the "Show More" button is hidden.
*/ */
$('#release-toc .show-more').click(function () { const showMoreBtn = document.querySelector('#release-toc .show-more');
const itemHeight = 1.885; // Item height in rem if (showMoreBtn) {
const releaseNum = releaseData.length; showMoreBtn.addEventListener('click', function () {
const maxHeight = releaseNum * itemHeight; const itemHeight = 1.885; // Item height in rem
const releaseIncrement = Number($('#release-list')[0].getAttribute('show')); const releaseNum = releaseData.length;
const currentHeight = Number( const maxHeight = releaseNum * itemHeight;
$('#release-list')[0].style.height.match(/\d+\.?\d+/)[0] const releaseList = document.getElementById('release-list');
); const releaseIncrement = Number(releaseList.getAttribute('show'));
const potentialHeight = currentHeight + releaseIncrement * itemHeight; const currentHeightMatch = releaseList.style.height.match(/\d+\.?\d+/);
const newHeight = potentialHeight > maxHeight ? maxHeight : potentialHeight; const currentHeight = currentHeightMatch
? Number(currentHeightMatch[0])
: 0;
const potentialHeight = currentHeight + releaseIncrement * itemHeight;
const newHeight = potentialHeight > maxHeight ? maxHeight : potentialHeight;
$('#release-list')[0].style.height = `${newHeight}rem`; releaseList.style.height = `${newHeight}rem`;
if (newHeight >= maxHeight) { if (newHeight >= maxHeight) {
$('#release-toc .show-more').fadeOut(100); // Simple fade out
} showMoreBtn.style.transition = 'opacity 0.1s';
}); showMoreBtn.style.opacity = 0;
setTimeout(() => {
showMoreBtn.style.display = 'none';
}, 100);
}
});
}

View File

@ -3,7 +3,8 @@
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"*": [ "*": [
"*" "*",
"../node_modules/*"
] ]
} }
} }

View File

@ -51,7 +51,7 @@ Use the following command to return the image Kubernetes uses to build your
InfluxDB cluster: InfluxDB cluster:
```sh ```sh
kubectl get appinstances.kubecfg.dev influxdb -o jsonpath='{.spec.package.image}' kubectl get appinstances.kubecfg.dev influxdb -n influxdb -o jsonpath='{.spec.package.image}'
``` ```
The package version number is at the end of the returned string (after `influxdb:`): The package version number is at the end of the returned string (after `influxdb:`):
@ -66,8 +66,8 @@ us-docker.pkg.dev/influxdb2-artifacts/clustered/influxdb:PACKAGE_VERSION
### Identify the version to upgrade to ### Identify the version to upgrade to
All available InfluxDB Clustered package versions are provided at All available InfluxDB Clustered package versions are provided in the
[oci.influxdata.com](https://oci.influxdata.com). [InfluxDB Clustered release notes](/influxdb3/clustered/reference/release-notes/clustered/).
Find the package version you want to upgrade to and copy the version number. Find the package version you want to upgrade to and copy the version number.
@ -76,7 +76,7 @@ Find the package version you want to upgrade to and copy the version number.
Some InfluxDB Clustered releases are _checkpoint releases_ that introduce a Some InfluxDB Clustered releases are _checkpoint releases_ that introduce a
breaking change to an InfluxDB component. breaking change to an InfluxDB component.
Checkpoint releases are only made when absolutely necessary and are clearly Checkpoint releases are only made when absolutely necessary and are clearly
identified at [oci.influxdata.com](https://oci.influxdata.com). identified in the [InfluxDB Clustered release notes](/influxdb3/clustered/reference/release-notes/clustered/).
**When upgrading, always upgrade to each checkpoint release first, before proceeding **When upgrading, always upgrade to each checkpoint release first, before proceeding
to newer versions.** to newer versions.**

View File

@ -407,15 +407,15 @@ if __name__ == '__main__':
agent.handler = h agent.handler = h
# Anything printed to STDERR from a UDF process gets captured into the Kapacitor logs. # Anything printed to STDERR from a UDF process gets captured into the Kapacitor logs.
print >> sys.stderr, "Starting agent for TTestHandler" print("Starting agent for TTestHandler", file=sys.stderr)
agent.start() agent.start()
agent.wait() agent.wait()
print >> sys.stderr, "Agent finished" print("Agent finished", file=sys.stderr)
``` ```
That was a lot, but now we are ready to configure Kapacitor to run our That was a lot, but now we are ready to configure Kapacitor to run our
code. Create a scratch dir for working through the rest of this code. Make sure that `scipy` is installed (`$ pip3 install scipy`). Create a scratch dir for working through the rest of this
guide: guide:
```bash ```bash
@ -434,7 +434,7 @@ Add this snippet to your Kapacitor configuration file (typically located at `/et
[udf.functions] [udf.functions]
[udf.functions.tTest] [udf.functions.tTest]
# Run python # Run python
prog = "/usr/bin/python2" prog = "/usr/bin/python3"
# Pass args to python # Pass args to python
# -u for unbuffered STDIN and STDOUT # -u for unbuffered STDIN and STDOUT
# and the path to the script # and the path to the script
@ -468,8 +468,8 @@ correctly:
service kapacitor restart service kapacitor restart
``` ```
Check the logs (`/var/log/kapacitor/`) to make sure you see a Check the logs (`/var/log/kapacitor/` or `journalctl -f -n 256 -u kapacitor.service`) to make sure you see a
*Listening for signals* line and that no errors occurred. If you _Listening for signals_ line and that no errors occurred. If you
don't see the line, it's because the UDF process is hung and not don't see the line, it's because the UDF process is hung and not
responding. It should be killed after a timeout, so give it a moment responding. It should be killed after a timeout, so give it a moment
to stop properly. Once stopped, you can fix any errors and try again. to stop properly. Once stopped, you can fix any errors and try again.
@ -544,6 +544,20 @@ the Kapacitor task:
kapacitor define print_temps -tick print_temps.tick kapacitor define print_temps -tick print_temps.tick
``` ```
Ensure that the task is enabled:
```bash
kapacitor enable print_temps
```
And then list the tasks:
```bash
kapacitor list tasks
ID Type Status Executing Databases and Retention Policies
print_temps stream enabled true ["printer"."autogen"]
```
### Generating test data ### Generating test data
To simulate our printer for testing, we will write a simple Python To simulate our printer for testing, we will write a simple Python
@ -557,7 +571,7 @@ to use real data for testing our TICKscript and UDF, but this is
faster (and much cheaper than a 3D printer). faster (and much cheaper than a 3D printer).
```python ```python
#!/usr/bin/python2 #!/usr/bin/env python
from numpy import random from numpy import random
from datetime import timedelta, datetime from datetime import timedelta, datetime
@ -672,7 +686,11 @@ fake data so that we can easily iterate on the task:
```sh ```sh
# Start the recording in the background # Start the recording in the background
kapacitor record stream -task print_temps -duration 24h -no-wait kapacitor record stream -task print_temps -duration 24h -no-wait
# Grab the ID from the output and store it in a var # List recordings to find the ID
kapacitor list recordings
ID Type Status Size Date
7bd3ced5-5e95-4a67-a0e1-f00860b1af47 stream running 0 B 04 May 16 11:34 MDT
# Copy the ID and store it in a variable
rid=7bd3ced5-5e95-4a67-a0e1-f00860b1af47 rid=7bd3ced5-5e95-4a67-a0e1-f00860b1af47
# Run our python script to generate data # Run our python script to generate data
chmod +x ./printer_data.py chmod +x ./printer_data.py

View File

@ -11,7 +11,7 @@ menu:
weight: 60 weight: 60
--- ---
## v1.34.1 [2025-03-24] ## v1.34.1 {date="2025-03-24"}
### Bugfixes ### Bugfixes
@ -40,7 +40,7 @@ menu:
- [#16653](https://github.com/influxdata/telegraf/pull/16653) `deps` Bump k8s.io/api from 0.32.1 to 0.32.3 - [#16653](https://github.com/influxdata/telegraf/pull/16653) `deps` Bump k8s.io/api from 0.32.1 to 0.32.3
- [#16659](https://github.com/influxdata/telegraf/pull/16659) `deps` Bump tj-actions/changed-files from v45 to v46.0.1 - [#16659](https://github.com/influxdata/telegraf/pull/16659) `deps` Bump tj-actions/changed-files from v45 to v46.0.1
## v1.34.0 [2025-03-10] ## v1.34.0 {date="2025-03-10"}
### New Plugins ### New Plugins
@ -94,7 +94,7 @@ menu:
- [#16575](https://github.com/influxdata/telegraf/pull/16575) `deps` Bump github.com/tidwall/wal from 1.1.7 to 1.1.8 - [#16575](https://github.com/influxdata/telegraf/pull/16575) `deps` Bump github.com/tidwall/wal from 1.1.7 to 1.1.8
- [#16578](https://github.com/influxdata/telegraf/pull/16578) `deps` Bump super-linter/super-linter from 7.2.1 to 7.3.0 - [#16578](https://github.com/influxdata/telegraf/pull/16578) `deps` Bump super-linter/super-linter from 7.2.1 to 7.3.0
## v1.33.3 [2025-02-25] ## v1.33.3 {date="2025-02-25"}
### Important Changes ### Important Changes
@ -128,7 +128,7 @@ menu:
- [#16504](https://github.com/influxdata/telegraf/pull/16504) `deps` Bump golang.org/x/net from 0.34.0 to 0.35.0 - [#16504](https://github.com/influxdata/telegraf/pull/16504) `deps` Bump golang.org/x/net from 0.34.0 to 0.35.0
- [#16512](https://github.com/influxdata/telegraf/pull/16512) `deps` Bump golangci-lint from v1.63.4 to v1.64.5 - [#16512](https://github.com/influxdata/telegraf/pull/16512) `deps` Bump golangci-lint from v1.63.4 to v1.64.5
## v1.33.2 [2025-02-10] ## v1.33.2 {date="2025-02-10"}
### Important Changes ### Important Changes
@ -177,7 +177,7 @@ menu:
- [#16482](https://github.com/influxdata/telegraf/pull/16482) `deps` Update Apache arrow from 0.0-20240716144821-cf5d7c7ec3cf to 18.1.0 - [#16482](https://github.com/influxdata/telegraf/pull/16482) `deps` Update Apache arrow from 0.0-20240716144821-cf5d7c7ec3cf to 18.1.0
- [#16423](https://github.com/influxdata/telegraf/pull/16423) `deps` Update ClickHouse SQL driver from 1.5.4 to to 2.30.1 - [#16423](https://github.com/influxdata/telegraf/pull/16423) `deps` Update ClickHouse SQL driver from 1.5.4 to to 2.30.1
## v1.33.1 [2025-01-10] ## v1.33.1 {date="2025-01-10"}
### Important Changes ### Important Changes