From 053d08495a168c87841f50a05eeab77f50ec5b45 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:17:07 +0000 Subject: [PATCH 1/6] Create sweep.yaml --- sweep.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 sweep.yaml diff --git a/sweep.yaml b/sweep.yaml new file mode 100644 index 0000000..89e1d02 --- /dev/null +++ b/sweep.yaml @@ -0,0 +1,27 @@ +# Sweep AI turns bugs & feature requests into code changes (https://sweep.dev) +# For details on our config file, check out our docs at https://docs.sweep.dev/usage/config + +# This setting contains a list of rules that Sweep will check for. If any of these rules are broken in a new commit, Sweep will create an pull request to fix the broken rule. +rules: + - "All new business logic should have corresponding unit tests." + - "Refactor large functions to be more modular." + - "Add docstrings to all functions and file headers." + +# This is the branch that Sweep will develop from and make pull requests to. Most people use 'main' or 'master' but some users also use 'dev' or 'staging'. +branch: 'main' + +# By default Sweep will read the logs and outputs from your existing Github Actions. To disable this, set this to false. +gha_enabled: True + +# This is the description of your project. It will be used by sweep when creating PRs. You can tell Sweep what's unique about your project, what frameworks you use, or anything else you want. +# +# Example: +# +# description: sweepai/sweep is a python project. The main api endpoints are in sweepai/api.py. Write code that adheres to PEP8. +description: '' + +# This sets whether to create pull requests as drafts. If this is set to True, then all pull requests will be created as drafts and GitHub Actions will not be triggered. +draft: False + +# This is a list of directories that Sweep will not be able to edit. +blocked_dirs: [] From ad09e8c454b3fabf55009dc367ad0c5b09d3cd1a Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:17:07 +0000 Subject: [PATCH 2/6] Create sweep template --- .github/ISSUE_TEMPLATE/sweep-template.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/sweep-template.yml diff --git a/.github/ISSUE_TEMPLATE/sweep-template.yml b/.github/ISSUE_TEMPLATE/sweep-template.yml new file mode 100644 index 0000000..9d687a3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/sweep-template.yml @@ -0,0 +1,22 @@ +name: Sweep Issue +title: 'Sweep: ' +description: For small bugs, features, refactors, and tests to be handled by Sweep, an AI-powered junior developer. +labels: sweep +body: + - type: textarea + id: description + attributes: + label: Details + description: Tell Sweep where and what to edit and provide enough context for a new developer to the codebase + placeholder: | + Unit Tests: Write unit tests for . Test each function in the file. Make sure to test edge cases. + Bugs: The bug might be in . Here are the logs: ... + Features: the new endpoint should use the ... class from because it contains ... logic. + Refactors: We are migrating this function to ... version because ... + - type: input + id: branch + attributes: + label: Branch + description: The branch to work off of (optional) + placeholder: | + main \ No newline at end of file From c0d23d2b349b3598ea670458a70e3e385a214da8 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:18:58 +0000 Subject: [PATCH 3/6] feat: Updated index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c124fde..74273a6 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ class LokiTransport extends Transport { batching: options.batching !== false, clearOnError: options.clearOnError, onConnectionError: options.onConnectionError, - replaceTimestamp: options.replaceTimestamp, + replaceTimestamp: options.replaceTimestamp !== false, gracefulShutdown: options.gracefulShutdown !== false, timeout: options.timeout }) From e35241a2c43688fb0126865fc9f43fc8bee3a257 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:19:34 +0000 Subject: [PATCH 4/6] feat: Updated index.js --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c124fde..5355344 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,8 @@ class LokiTransport extends Transport { }) // Deconstruct the log - const { label, labels, timestamp, level, message, ...rest } = info + const { label, labels, timestamp, message, ...rest } = info + const level = info[Symbol.for('level')] // build custom labels if provided let lokiLabels = { level: level } From e2796413cbd3fa63c98b0b866a2de20fa950815b Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:20:01 +0000 Subject: [PATCH 5/6] feat: Updated README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ecb1a3a..1973af9 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ LokiTransport() takes a Javascript object as an input. These are the options tha | `json` | Use JSON instead of Protobuf for transport | true | false | | `batching` | If batching is not used, the logs are sent as they come | true | true | | `clearOnError` | Discard any logs that result in an error during transport | true | false | -| `replaceTimestamp` | Replace any log timestamps with Date.now() | true | false | +| `replaceTimestamp` | Replace any log timestamps with Date.now(). Warning: Disabling `replaceTimestamp` may result in logs failing to upload due to recent changes in the upstream Loki project. It is recommended to leave this option enabled unless you have a specific reason to disable it. | true | true | | `labels` | custom labels, key-value pairs | { module: 'http' } | undefined | | `format` | winston format (https://github.com/winstonjs/winston#formats) | simple() | undefined | | `gracefulShutdown` | Enable/disable graceful shutdown (wait for any unsent batches) | false | true | From 952a5763c9eebb7afcf8619d634fb7180c680fbb Mon Sep 17 00:00:00 2001 From: Jani Anttonen Date: Tue, 9 Apr 2024 10:22:00 +0300 Subject: [PATCH 6/6] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cea0477..66fc4e0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "winston-loki", - "version": "6.0.8", + "version": "6.1.0", "description": "A Winston transport for Grafana Loki", "keywords": [ "winston",