{
  "_class" : "hudson.model.FreeStyleBuild",
  "actions" : [
    {
      "_class" : "hudson.model.CauseAction",
      "causes" : [
        {
          "_class" : "com.cloudbees.jenkins.GitHubPushCause",
          "shortDescription" : "Started by GitHub push by ti-chi-bot[bot]"
        },
        {
          "_class" : "com.cloudbees.jenkins.GitHubPushCause",
          "shortDescription" : "Started by GitHub push by ti-chi-bot[bot]"
        }
      ]
    },
    {
      
    },
    {
      "_class" : "jenkins.metrics.impl.TimeInQueueAction",
      "blockedDurationMillis" : 0,
      "blockedTimeMillis" : 0,
      "buildableDurationMillis" : 36888,
      "buildableTimeMillis" : 36888,
      "buildingDurationMillis" : 46617,
      "executingTimeMillis" : 46617,
      "executorUtilization" : 1.0,
      "subTaskCount" : 0,
      "waitingDurationMillis" : 8211,
      "waitingTimeMillis" : 8211
    },
    {
      "_class" : "hudson.plugins.git.util.BuildData",
      "buildsByBranchName" : {
        "origin/main" : {
          "_class" : "hudson.plugins.git.util.Build",
          "buildNumber" : 1055,
          "buildResult" : None,
          "marked" : {
            "SHA1" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
            "branch" : [
              {
                "SHA1" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
                "name" : "origin/main"
              }
            ]
          },
          "revision" : {
            "SHA1" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
            "branch" : [
              {
                "SHA1" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
                "name" : "origin/main"
              }
            ]
          }
        }
      },
      "lastBuiltRevision" : {
        "SHA1" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
        "branch" : [
          {
            "SHA1" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
            "name" : "origin/main"
          }
        ]
      },
      "remoteUrls" : [
        "https://github.com/PingCAP-QE/ci.git"
      ],
      "scmName" : ""
    },
    {
      
    },
    {
      
    },
    {
      
    },
    {
      
    },
    {
      
    },
    {
      
    },
    {
      "_class" : "org.jenkinsci.plugins.displayurlapi.actions.RunDisplayAction"
    }
  ],
  "artifacts" : [
    
  ],
  "building" : False,
  "description" : None,
  "displayName" : "#1055",
  "duration" : 46617,
  "estimatedDuration" : 57360,
  "executor" : None,
  "fullDisplayName" : "seed #1055",
  "id" : "1055",
  "inProgress" : False,
  "keepLog" : False,
  "number" : 1055,
  "queueId" : 2137544,
  "result" : "SUCCESS",
  "timestamp" : 1760067427609,
  "url" : "https://do.pingcap.net/jenkins/job/seed/1055/",
  "builtOn" : "default-l1z17",
  "changeSet" : {
    "_class" : "hudson.plugins.git.GitChangeSetList",
    "items" : [
      {
        "_class" : "hudson.plugins.git.GitChangeSet",
        "affectedPaths" : [
          ".gitignore",
          "tools/error-log-review/config.yaml.example",
          "tools/error-log-review/config.go",
          "tools/error-log-review/README.md",
          "configs/error-log-review/config.yaml",
          "tools/error-log-review/matcher_test.go",
          "tools/error-log-review/matcher.go"
        ],
        "commitId" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
        "timestamp" : 1760067378000,
        "author" : {
          "absoluteUrl" : "https://do.pingcap.net/jenkins/user/noreply",
          "fullName" : "noreply"
        },
        "authorEmail" : "noreply@github.com",
        "comment" : "feat: Add exclusion patterns support to error-log-review CI tool (#3787)\u000a\u000a## \ud83c\udfaf Overview\u000a\u000aThis PR adds support for exclusion patterns in the error-log-review CI\u000atool, allowing test code and other non-production paths to be ignored by\u000aspecific rules or globally per repository.\u000a\u000a## \ud83d\udc1b Problem\u000a\u000aThe error-log-review CI was flagging log statements in test files,\u000acreating noise and false positives. For example, in [this PR\u000arun](https://prow.tidb.net/view/gs/prow-tidb-logs/pr-logs/pull/pingcap_ticdc/2337/pull-error-log-review/1976460951846653952):\u000a\u000a```\u000atests/integration_tests/ddl_wait/test.go [string_literals]: log.Fatalf(\"insert value failed:, host:%s, port:%s, k:%d, i:%d, val:%d, num:%d, err: %+v\", host, port, k, i, val, num, err)\u000atests/integration_tests/ddl_wait/test.go [variables_and_functions]: log.Fatalf(\"insert value failed:, host:%s, port:%s, k:%d, i:%d, val:%d, num:%d, err: %+v\", host, port, k, i, val, num, err)\u000a```\u000a\u000aTest code often uses different logging patterns and doesn't require the\u000asame scrutiny as production code.\u000a\u000a## ✨ Solution\u000a\u000aImplemented a two-level exclusion system using glob patterns:\u000a\u000a### 1. Pattern-Specific Excludes\u000aApply exclusions to individual patterns only:\u000a\u000a```yaml\u000apatterns:\u000a  - name: \"string_literals\"\u000a    regex: '...'\u000a    excludes:\u000a      - \"tests/**\"           # Exclude all files under tests/\u000a      - \"*_test.go\"          # Exclude all Go test files\u000a      - \"examples/**\"        # Exclude examples directory\u000a```\u000a\u000a### 2. Repository-Level Excludes\u000aApply exclusions to all patterns in a repository:\u000a\u000a```yaml\u000arepositories:\u000a  - name: \"owner/repo\"\u000a    excludes:\u000a      - \"vendor/**\"\u000a      - \"third_party/**\"\u000a    patterns:\u000a      - name: \"...\"\u000a```\u000a\u000a### Glob Pattern Support\u000a- `*` - matches any sequence of characters in a filename (e.g.,\u000a`*_test.go`)\u000a- `**` - matches directories recursively (e.g., `tests/**` matches all\u000afiles under tests/ and subdirectories)\u000a- `?` - matches any single character\u000a\u000a## \ud83d\udcdd Changes\u000a\u000a### Code Changes\u000a- **`config.go`**: Added `Excludes []string` field to both `Pattern` and\u000a`Repository` structs\u000a- **`config.go`**: Implemented `matchesAnyPattern()` function for glob\u000apattern matching\u000a- **`matcher.go`**: Updated `CheckPRDiff()` to check exclusions before\u000aapplying pattern matching\u000a\u000a### Configuration\u000a- **`configs/error-log-review/config.yaml`**: Added `excludes:\u000a[\"tests/**\"]` to `pingcap/ticdc` patterns to fix the reported issue\u000a- **`config.yaml.example`**: Added comprehensive documentation and\u000aexamples\u000a\u000a### Documentation\u000a- **`README.md`**: Added \"Exclusion Patterns\" section with detailed\u000aexamples and glob syntax reference\u000a\u000a### Testing\u000a- **`matcher_test.go`**: Created comprehensive test suite with:\u000a  - `TestMatchesAnyPattern` - Tests glob pattern matching (8 test cases)\u000a  - `TestCheckPRDiffWithExclusions` - Tests end-to-end exclusion logic\u000a  - `TestTiCDCExclusionScenario` - Tests the specific issue scenario\u000a  - All tests passing ✅\u000a\u000a## \ud83d\udd0d Example Usage\u000a\u000a```yaml\u000arepositories:\u000a  - name: \"pingcap/ticdc\"\u000a    patterns:\u000a      - name: \"string_literals\"\u000a        description: \"Pattern for string literals\"\u000a        regex: '...'\u000a        excludes:\u000a          - \"tests/**\"      # Now test files won't trigger this rule\u000a    approvers:\u000a      - \"flowbehappy\"\u000a```\u000a\u000a## ✅ Verification\u000a\u000a- All tests pass (3 test suites, 10 test cases)\u000a- Build succeeds\u000a- Code formatted with `go fmt`\u000a- No `go vet` issues\u000a- Configuration validated with YAML parser\u000a\u000a## \ud83c\udf89 Impact\u000a\u000a- **Immediate**: Fixes the false positives for `pingcap/ticdc` test\u000afiles\u000a- **Future**: Any repository can now configure exclusions without code\u000achanges\u000a- **Flexible**: Supports both global and pattern-specific exclusions\u000a- **Backward Compatible**: Existing configurations continue to work\u000aunchanged\u000a\u000aFixes #[issue_number]\u000a\u000a<!-- START COPILOT CODING AGENT SUFFIX -->\u000a\u000a\u000a\u000a<details>\u000a\u000a<summary>Original prompt</summary>\u000a\u000a> \u000a> ----\u000a> \u000a> *This section details on the original issue you should resolve*\u000a> \u000a> <issue_title>Support exclusion patterns in pull-error-log-review CI\u000a(exclude test code)</issue_title>\u000a> <issue_description>## \ud83e\udea7 Summary\u000a> Add support for exclusion patterns in the error-log review CI job\u000a(pull-error-log-review) so test code and other non-production paths can\u000abe ignored by specific rules.\u000a> \u000a> ## \ud83d\ude4b Problem\u000a> Currently, the job flags issues in test files, which creates noise and\u000afalse positives. Example from a recent run:\u000a> - tests/integration_tests/ddl_wait/test.go [string_literals]:\u000alog.Fatalf(\"insert value failed:, host:%s, port:%s, k:%d, i:%d, val:%d,\u000anum:%d, err: %+v\", host, port, k, i, val, num, err)\u000a> - tests/integration_tests/ddl_wait/test.go [variables_and_functions]:\u000alog.Fatalf(\"insert value failed:, host:%s, port:%s, k:%d, i:%d, val:%d,\u000anum:%d, err: %+v\", host, port, k, i, val, num, err)\u000a> \u000a> ## Example CI run\u000a>\u000ahttps://prow.tidb.net/view/gs/prow-tidb-logs/pr-logs/pull/pingcap_ticdc/2337/pull-error-log-review/1976460951846653952\u000a> \u000a> ## \ud83d\udcc4 Proposal\u000a> - Add configurable exclusion patterns (e.g., glob paths) so we can\u000aexclude directories like tests/** by default, or on a per-repo basis.\u000a> - Consider supporting both:\u000a>   - Global excludes (apply to all rules), and\u000a> - Rule-specific excludes (e.g., exclude tests/** only for\u000astring_literals and variables_and_functions).\u000a> - Allow repo-level configuration (e.g., a YAML config) to declare\u000aexcludes without changing CI code for each repo.\u000a> \u000a> ## \ud83e\uddd0 Acceptance criteria\u000a> - The job supports path-based exclude patterns.\u000a> - Can define global and rule-specific excludes.\u000a> - Document how to configure excludes for a repository.\u000a> - Test files such as tests/integration_tests/** are not flagged by the\u000aabove rules once configured.\u000a> </issue_description>\u000a> \u000a> ## Comments on the Issue (you are @copilot in this section)\u000a> \u000a> <comments>\u000a> <comment_new><author>@wuhuizuo</author><body>\u000a> /assign @lybcodes </body></comment_new>\u000a> <comment_new><author>@wuhuizuo</author><body>\u000a> The CI tool information:\u000a> - code path: tools/error-log-review\u000a> - config path:\u000aconfigs/error-log-review/config.yaml</body></comment_new>\u000a> </comments>\u000a> \u000a\u000a\u000a</details>\u000a\u000aFixes PingCAP-QE/ci#3786\u000a\u000a<!-- START COPILOT CODING AGENT TIPS -->\u000a---\u000a\u000a\ud83d\udca1 You can make Copilot smarter by setting up custom instructions,\u000acustomizing its development environment and configuring Model Context\u000aProtocol (MCP) servers. Learn more [Copilot coding agent\u000atips](https://gh.io/copilot-coding-agent-tips) in the docs.\u000a\u000a---------\u000a\u000aCo-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>\u000aCo-authored-by: wuhuizuo <2574558+wuhuizuo@users.noreply.github.com>\u000aCo-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>\u000a",
        "date" : "2025-10-10 03:36:18 +0000",
        "id" : "f9dacd257266ea0b88227be9429b2d833b5b1b70",
        "msg" : "feat: Add exclusion patterns support to error-log-review CI tool (#3787)",
        "paths" : [
          {
            "editType" : "edit",
            "file" : "tools/error-log-review/config.yaml.example"
          },
          {
            "editType" : "edit",
            "file" : "tools/error-log-review/config.go"
          },
          {
            "editType" : "add",
            "file" : "tools/error-log-review/matcher_test.go"
          },
          {
            "editType" : "edit",
            "file" : "configs/error-log-review/config.yaml"
          },
          {
            "editType" : "edit",
            "file" : ".gitignore"
          },
          {
            "editType" : "edit",
            "file" : "tools/error-log-review/README.md"
          },
          {
            "editType" : "edit",
            "file" : "tools/error-log-review/matcher.go"
          }
        ]
      }
    ],
    "kind" : "git"
  },
  "culprits" : [
    {
      "absoluteUrl" : "https://do.pingcap.net/jenkins/user/noreply",
      "fullName" : "noreply"
    }
  ]
}