diff --git a/.circleci/config.yml b/.circleci/config.yml index a8808aac3..2bf73dcc2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,4 @@ -version: 2 +version: 2.1 jobs: build: docker: @@ -68,7 +68,6 @@ jobs: when: on_success workflows: - version: 2 build: jobs: - build diff --git a/.vscode/launch.json b/.vscode/launch.json index b98c9b2f4..8c573a2eb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,19 +1,18 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { + "name": "Debug Docs (console-based)", "type": "chrome", "request": "launch", - "name": "Open Docs on localhost:1313", "url": "http://localhost:1313", "webRoot": "${workspaceFolder}", "skipFiles": [ - "/**", - "${workspaceFolder}/node_modules/**" - ] + "/**" + ], + "sourceMaps": false, + "trace": true, + "smartStep": false } ] } \ No newline at end of file diff --git a/assets/js/local-storage.js b/assets/js/local-storage.js index 526df1fd4..4ab14b7d5 100644 --- a/assets/js/local-storage.js +++ b/assets/js/local-storage.js @@ -82,13 +82,16 @@ function getPreferences() { //////////// MANAGE INFLUXDATA DOCS URLS IN LOCAL STORAGE ////////////////////// //////////////////////////////////////////////////////////////////////////////// - const defaultUrls = {}; // Guard against pageParams being null/undefined and safely access nested properties if (pageParams && pageParams.influxdb_urls) { - Object.entries(pageParams.influxdb_urls).forEach(([product, {providers}]) => { - defaultUrls[product] = providers.filter(provider => provider.name === 'Default')[0]?.regions[0]?.url || 'https://cloud2.influxdata.com'; - }); + Object.entries(pageParams.influxdb_urls).forEach( + ([product, { providers }]) => { + defaultUrls[product] = + providers.filter((provider) => provider.name === 'Default')[0] + ?.regions[0]?.url || 'https://cloud2.influxdata.com'; + } + ); } export const DEFAULT_STORAGE_URLS = { @@ -177,7 +180,10 @@ const defaultNotificationsObj = { function getNotifications() { // Initialize notifications data if it doesn't already exist if (localStorage.getItem(notificationStorageKey) === null) { - initializeStorageItem('notifications', JSON.stringify(defaultNotificationsObj)); + initializeStorageItem( + 'notifications', + JSON.stringify(defaultNotificationsObj) + ); } // Retrieve and parse the notifications data as JSON @@ -221,7 +227,10 @@ function setNotificationAsRead(notificationID, notificationType) { readNotifications.push(notificationID); notificationsObj[notificationType + 's'] = readNotifications; - localStorage.setItem(notificationStorageKey, JSON.stringify(notificationsObj)); + localStorage.setItem( + notificationStorageKey, + JSON.stringify(notificationsObj) + ); } // Export functions as a module and make the file backwards compatible for non-module environments until all remaining dependent scripts are ported to modules diff --git a/assets/js/utils/debug-helpers.js b/assets/js/utils/debug-helpers.js new file mode 100644 index 000000000..08433e2cf --- /dev/null +++ b/assets/js/utils/debug-helpers.js @@ -0,0 +1,38 @@ +/** + * Helper functions for debugging without source maps + * Example usage: + * In your code, you can use these functions like this: + * ```javascript + * import { debugLog, debugBreak, debugInspect } from './debug-helpers.js'; + * + * const data = debugInspect(someData, 'Data'); + * debugLog('Processing data', 'myFunction'); + * + * function processData() { + * // Add a breakpoint that works with DevTools + * debugBreak(); + * + * // Your existing code... + * } + * ``` + * + * @fileoverview DEVELOPMENT USE ONLY - Functions should not be committed to production + */ + +/* eslint-disable no-debugger */ +/* eslint-disable-next-line */ +// NOTE: These functions are detected by ESLint rules to prevent committing debug code + +export function debugLog(message, context = '') { + const contextStr = context ? `[${context}]` : ''; + console.log(`DEBUG${contextStr}: ${message}`); +} + +export function debugBreak() { + debugger; +} + +export function debugInspect(value, label = 'Inspect') { + console.log(`DEBUG[${label}]:`, value); + return value; +} diff --git a/config/testing/config.yml b/config/testing/config.yml index 12d2cfd14..28b8d8dae 100644 --- a/config/testing/config.yml +++ b/config/testing/config.yml @@ -15,29 +15,6 @@ preserveTaxonomyNames: true # Generate a robots.txt enableRobotsTXT: true -# Override settings for testing -buildFuture: true - -# Configure what content is built in testing env -params: - env: testing - environment: testing - buildTestContent: true - -# Server configuration for testing -server: - port: 1315 - baseURL: 'http://localhost:1315/' - watchChanges: true - disableLiveReload: false - -# Keep your shared content exclusions -ignoreFiles: - - "content/shared/.*" - -# Ignore specific warning logs -ignoreLogs: - - warning-goldmark-raw-html # Markdown rendering options blackfriday: @@ -55,7 +32,6 @@ taxonomies: influxdb3/enterprise/tag: influxdb3/enterprise/tags flux/v0/tag: flux/v0/tags -# Markup configuration markup: goldmark: renderer: @@ -66,7 +42,6 @@ markup: attribute: block: true -# Privacy settings privacy: googleAnalytics: anonymizeIP: false @@ -77,7 +52,6 @@ privacy: disable: false privacyEnhanced: true -# Output formats outputFormats: json: mediaType: application/json @@ -86,11 +60,43 @@ outputFormats: # Asset processing for testing (disable minification) build: - writeStats: true + writeStats: false useResourceCacheWhen: "fallback" - buildOptions: - sourcemap: "inline" - target: "es2020" + noJSConfigInAssets: false + +# Asset processing configuration +assetDir: "assets" + +module: + mounts: + - source: assets + target: assets + - source: node_modules + target: assets/node_modules + +# Override settings for testing +buildFuture: true + +# Configure what content is built in testing env +params: + env: testing + environment: testing + buildTestContent: true + +# Configure the server for testing +server: + port: 1315 + baseURL: 'http://localhost:1315/' + watchChanges: true + disableLiveReload: false + +# Keep your shared content exclusions +ignoreFiles: + - "content/shared/.*" + +# Ignore specific warning logs +ignoreLogs: + - warning-goldmark-raw-html # Disable minification for testing minify: @@ -98,14 +104,3 @@ minify: disableCSS: true disableHTML: true minifyOutput: false - -# Asset processing configuration -assetDir: "assets" - -# Module mounts -module: - mounts: - - source: assets - target: assets - - source: node_modules - target: assets/node_modules \ No newline at end of file diff --git a/content/kapacitor/v1/reference/about_the_project/release-notes.md b/content/kapacitor/v1/reference/about_the_project/release-notes.md index 4fb722a07..78182d7fd 100644 --- a/content/kapacitor/v1/reference/about_the_project/release-notes.md +++ b/content/kapacitor/v1/reference/about_the_project/release-notes.md @@ -9,6 +9,22 @@ aliases: - /kapacitor/v1/about_the_project/releasenotes-changelog/ --- +## v1.7.7 {date="2025-05-27"} + +> [!Warning] +> #### Python 2 UDFs deprecated +> +> Python 2-based UDFs are deprecated** as of Kapacitor 1.7.7 and will be removed in **Kapacitor 1.8.0**. +> +> In preparation for Kapacitor 1.8.0, update your User-Defined Functions (UDFs) to be Python 3-compatible. +> This required change aligns with modern security practices and ensures your custom functions will continue to work after upgrading. + +### Dependency updates + +- Upgrade Go to 1.22.12. + +--- + ## v1.7.6 {date="2024-10-28"} ### Features diff --git a/data/products.yml b/data/products.yml index 9e86821dc..fd7dd9572 100644 --- a/data/products.yml +++ b/data/products.yml @@ -172,7 +172,7 @@ kapacitor: versions: [v1] latest: v1.7 latest_patches: - v1: 1.7.6 + v1: 1.7.7 ai_sample_questions: - How do I configure Kapacitor for InfluxDB v1? - How do I write a custom Kapacitor task? diff --git a/eslint.config.js b/eslint.config.js index 0f7cd7e65..23104f7a1 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -106,6 +106,33 @@ export default [ files: ['assets/js/**/*.js'], rules: { // Rules specific to JavaScript in Hugo assets + // Prevent imports from debug-helpers.js + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: './utils/debug-helpers.js', + message: + 'Remove debugging functions before committing. Debug helpers should not be used in production code.', + }, + { + name: '/utils/debug-helpers.js', + message: + 'Remove debugging functions before committing. Debug helpers should not be used in production code.', + }, + ], + }, + ], + // Prevent use of debug functions in production code + 'no-restricted-syntax': [ + 'error', + { + selector: 'CallExpression[callee.name=/^debug(Log|Break|Inspect)$/]', + message: + 'Remove debugging functions before committing. Debug helpers should not be used in production code.', + }, + ], }, }, { diff --git a/hugo.yml b/hugo.yml index 3b34115e8..c6ed5a65c 100644 --- a/hugo.yml +++ b/hugo.yml @@ -49,6 +49,7 @@ privacy: youtube: disable: false privacyEnhanced: true + outputFormats: json: mediaType: application/json @@ -57,13 +58,8 @@ outputFormats: # Asset processing configuration for development build: - writeStats: true + writeStats: false useResourceCacheWhen: "fallback" - # Enable source maps for debugging - buildOptions: - sourcemap: "inline" - target: "es2020" - # Disable asset bundling in development noJSConfigInAssets: false # Asset processing configuration @@ -82,14 +78,17 @@ params: environment: development # Configure the server for development -# Specify the port for development to avoid conflicts with testing server: port: 1313 baseURL: 'http://localhost:1313/' watchChanges: true disableLiveReload: false -# Disable minification and bundling for development +# Ignore specific warning logs +ignoreLogs: + - warning-goldmark-raw-html + +# Disable minification for development minify: disableJS: true disableCSS: true diff --git a/layouts/partials/header/javascript.html b/layouts/partials/header/javascript.html index ea855ae8b..57e5c6293 100644 --- a/layouts/partials/header/javascript.html +++ b/layouts/partials/header/javascript.html @@ -23,17 +23,15 @@ {{ $mainJS := resources.Get "js/main.js" }} {{ if $mainJS }} {{ $opts := dict - "minify" false "sourceMap" "external" + "sourcesContent" true "targetPath" "js/main.js" - "params" $sharedParams "format" "esm" - "external" (slice "*") - "define" (dict - "process.env.NODE_ENV" "\"development\"" - ) - "splitting" false - "bundle" true + "bundle" false + "minify" false + "target" "es2017" + "write" true + "params" $sharedParams }} {{ $processed := $mainJS | js.Build $opts }} {{ if $processed }} @@ -47,25 +45,26 @@ {{ range $file := (readDir $jsDir) }} {{ if and (strings.HasSuffix $file.Name ".js") (ne $file.Name "main.js") }} {{ $jsPath := printf "js/%s" $file.Name }} - {{ $jsResource := resources.Get $jsPath }} - {{ if $jsResource }} + {{ $jsRes := resources.Get $jsPath }} + {{ with $jsRes }} {{ $opts := dict - "minify" false - "sourceMap" "external" + "sourceMap" "" "targetPath" $jsPath - "params" $sharedParams "format" "esm" - "external" (slice "*") - "define" (dict - "process.env.NODE_ENV" "\"development\"" - ) - "splitting" false - "bundle" true + "bundle" false + "minify" false + "target" "es2015" + "write" true + "params" $sharedParams }} - {{ $processed := $jsResource | js.Build $opts }} - {{ if $processed }} - - {{ end }} + {{ $out := . | js.Build $opts }} + + {{/* Add descriptive debug comments at the beginning of each file */}} + {{ $debugHeader := printf "// DEBUG MODE: %s\n// Original file: assets/js/%s\n\n" $file.Name $file.Name }} + {{ $modifiedContent := printf "%s%s" $debugHeader $out.Content }} + {{ $out = resources.FromString $jsPath $modifiedContent }} + + {{ end }} {{ end }} {{ end }} @@ -82,6 +81,7 @@ "targetPath" "js/main.js" "params" $sharedParams "format" "iife" + "target" "es2019" "splitting" false "external" (slice "*") "define" (dict