Skip to content
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

0213 hocon multiline string with indentation #12517

Merged

Conversation

zmstone
Copy link
Member

@zmstone zmstone commented Feb 15, 2024

Fixes EMQX-11598

Release version: v/e5.6.0

Summary

  • Upgrade to hocon 0.41.0 which supported multiline string with indentation.
    This is to get EMQX configuration out of escape-sequence hell for SQL programs for rule-engine.
  • Stop building markdown format docs.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix|breaking)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket docs: update type descriptions emqx-docs#2365
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

example:

rule_engine {
  ignore_sys_message = true
  jq_function_default_timeout = 10s
  rules {
    a_WH_D {
      actions = ["http:a_WH_D"]
      description = ""
      enable = true
      metadata {created_at = 1707562385536}
      name = ""
      sql = """~
        SELECT
          *
        FROM
          "#",
          "$events/message_delivered",
          "$events/message_acked",
          "$events/message_dropped",
          "$events/client_connected",
          "$events/client_disconnected",
          "$events/client_connack",
          "$events/client_check_authz_complete",
          "$events/session_subscribed",
          "$events/session_unsubscribed",
          "$events/delivery_dropped"~"""
    }
    rule_rc0w {
      actions = [
        {
          args {
            mqtt_properties {}
            payload = "${.}"
            qos = 0
            retain = false
            topic = "republish-event/${clientid}"
            user_properties = ""
          }
          function = republish
        },
        {function = console}
      ]
      enable = true
      metadata {created_at = 1707389712653}
      name = ""
      sql = """~
        SELECT
          *
        FROM
          "$events/client_connected",
          "$events/client_disconnected"
      ~"""
    }
    rule_xlu4 {
      actions = [
        {function = console}
      ]
      description = ""
      enable = true
      metadata {created_at = 1706611936022}
      name = ""
      sql = """~
        SELECT
          *
        FROM
          "t/#"
      ~"""
    }
  }
}

@zmstone zmstone force-pushed the 0213-hocon-multiline-string-with-indentation branch 3 times, most recently from 4719f9c to d5b592e Compare February 16, 2024 08:15
hocon 0.41.0 added support for multiline string indentation.
now there is no need to escape (unless there is backslash)
quotes and line feeds etc.
@zmstone zmstone force-pushed the 0213-hocon-multiline-string-with-indentation branch from d5b592e to 9d83370 Compare February 16, 2024 09:32
@zmstone zmstone force-pushed the 0213-hocon-multiline-string-with-indentation branch from 9d83370 to f57f617 Compare February 16, 2024 10:35
@zmstone zmstone marked this pull request as ready for review February 16, 2024 12:51
@zmstone zmstone merged commit 2b46cba into emqx:master Feb 16, 2024
166 checks passed
@zmstone zmstone deleted the 0213-hocon-multiline-string-with-indentation branch February 16, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants