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

Sharad/instrumentation #373

Closed
wants to merge 929 commits into from
Closed

Sharad/instrumentation #373

wants to merge 929 commits into from

Conversation

Imsharad
Copy link
Collaborator

🔄 Architecture and Tracing System Updates

Key Changes

Optimized tracing system:

  • Removed redundant raw_context and raw_response storage from traces table
  • Simplified schema by removing unnecessary constraints
  • Improved span processing logic in dbSpanProcessor.ts

Enhanced text generation:

  • Streamlined response handling across different model providers
  • Removed instrumentation overhead
  • Improved error handling and logging

Technical Details

Modified PostgreSQL schema:

  • Removed DEFAULT clauses for raw_context and raw_response
  • Simplified tracing schema
  • Optimized index creation

Other Updates:

  • Updated C-3PO character config to use OpenAI instead of Anthropic
  • Added .gitignore entries for build directories and documentation

Dependencies

  • Updated is-weakref from 1.1.0 to 1.1.1

Documentation

  • Added detailed system architecture documentation
  • Included comprehensive Mermaid diagram for request flow visualization

@Imsharad Imsharad closed this Feb 13, 2025
host: process.env.DB_HOST || 'localhost',
port: Number(process.env.DB_PORT) || 5432,
database: process.env.DB_DATABASE || 'tracing_database',
user: process.env.DB_USER || 'trace_user',

Check failure

Code scanning / CodeQL

Hard-coded credentials Critical

The hard-coded value "trace_user" is used as
user name
.
)
.join("\n");
state.title = content.title;
state.body = content.body.replace(/\n/g, '\\n').replace(/`/g, '\\`');

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

Copilot Autofix AI 16 days ago

To fix the problem, we need to ensure that backslashes in the input string are properly escaped. This can be done by adding a replace call to escape backslashes before escaping other characters. Specifically, we should replace each backslash with a double backslash. This ensures that any backslashes in the input are correctly handled and do not cause issues in subsequent processing.

Suggested changeset 1
packages/plugin-github/src/plugins/createIssue.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/plugin-github/src/plugins/createIssue.ts b/packages/plugin-github/src/plugins/createIssue.ts
--- a/packages/plugin-github/src/plugins/createIssue.ts
+++ b/packages/plugin-github/src/plugins/createIssue.ts
@@ -93,3 +93,3 @@
         state.title = content.title;
-        state.body = content.body.replace(/\n/g, '\\n').replace(/`/g, '\\`');
+        state.body = content.body.replace(/\\/g, '\\\\').replace(/\n/g, '\\n').replace(/`/g, '\\`');
 
EOF
@@ -93,3 +93,3 @@
state.title = content.title;
state.body = content.body.replace(/\n/g, '\\n').replace(/`/g, '\\`');
state.body = content.body.replace(/\\/g, '\\\\').replace(/\n/g, '\\n').replace(/`/g, '\\`');

Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options

// Detect file header
if (line.startsWith("diff --git")) {
const match = line.match(/a\/(.+) b\/(.+)/);

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with 'a/' and with many repetitions of 'a/a'.
This
regular expression
that depends on
library input
may run slow on strings starting with 'a/' and with many repetitions of 'a/a'.
@Imsharad Imsharad deleted the sharad/instrumentation branch February 13, 2025 15:04
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.