Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
12
12
language
stringclasses
6 values
repo_context
stringlengths
8
49
diff
stringlengths
268
2.2k
commit_message
stringlengths
43
92
conventional_commit
stringlengths
43
92
commit_type
stringclasses
7 values
scope
stringlengths
0
14
breaking_change
bool
2 classes
difficulty
stringclasses
3 values
9a197e32a5f6
javascript
Node.js REST API
diff --git a/middleware/rateLimit.js b/middleware/rateLimit.js --- a/middleware/rateLimit.js +++ b/middleware/rateLimit.js @@ -0,0 +1,24 @@ +const redis = require('redis'); +const client = redis.createClient({ url: process.env.REDIS_URL }); +client.connect(); + +const WINDOW_MS = 60_000; +const MAX_REQUESTS = 100; + +a...
feat(middleware): add Redis-backed sliding-window rate limiter (100 req/min)
feat(middleware): add Redis-backed sliding-window rate limiter (100 req/min)
feat
middleware
false
medium
a58dcb77a51e
python
pytest test suite
diff --git a/tests/test_api.py b/tests/test_api.py --- a/tests/test_api.py +++ b/tests/test_api.py @@ -0,0 +1,36 @@ +import pytest +from fastapi.testclient import TestClient +from app.main import app + +client = TestClient(app) + + +def test_root_returns_200(): + resp = client.get("/") + assert resp.status_code =...
test(api): add parametrized endpoint smoke tests and item creation validation tests
test(api): add parametrized endpoint smoke tests and item creation validation tests
test
api
false
medium
68d34b1d5617
python
API client library — public interface change
diff --git a/client/api.py b/client/api.py --- a/client/api.py +++ b/client/api.py @@ -15,14 +15,13 @@ class APIClient: - def get_user(self, user_id: int) -> dict: - """Return user dict. Deprecated: use get_user_model instead.""" - return self._get(f"/users/{user_id}").json() - - def get_user_model(...
feat(client)!: get_user now returns User model instead of dict
feat(client)!: get_user now returns User model instead of dict
feat
client
true
simple
f7e111aedf10
python
Django REST Framework API
diff --git a/api/permissions.py b/api/permissions.py --- a/api/permissions.py +++ b/api/permissions.py @@ -0,0 +1,18 @@ +from rest_framework.permissions import BasePermission + + +class IsOwnerOrAdmin(BasePermission): + def has_object_permission(self, request, view, obj): + if request.user.is_staff: + ...
feat(permissions): add IsOwnerOrAdmin permission class for DRF views
feat(permissions): add IsOwnerOrAdmin permission class for DRF views
feat
permissions
false
simple
caac7d340be1
python
Flask REST API
diff --git a/app/resources/orders.py b/app/resources/orders.py --- a/app/resources/orders.py +++ b/app/resources/orders.py @@ -0,0 +1,28 @@ +from flask import request, jsonify +from flask_restful import Resource +from app.models import Order, db +from app.schemas import OrderSchema + +order_schema = OrderSchema() + + +...
feat(orders): add paginated order list and create endpoints
feat(orders): add paginated order list and create endpoints
feat
orders
false
medium
b8fc453afb50
python
Async task queue
diff --git a/queue/worker.py b/queue/worker.py --- a/queue/worker.py +++ b/queue/worker.py @@ -67,7 +67,8 @@ class Worker: async def _heartbeat(self): - while True: + while self._running: await asyncio.sleep(HEARTBEAT_INTERVAL) await self.redis.set(f"worker:{self.id}:heartbe...
fix(worker): stop heartbeat loop when worker shuts down
fix(worker): stop heartbeat loop when worker shuts down
fix
worker
false
simple
4d3fa5dff59d
java
Spring Boot REST API
diff --git a/src/main/java/com/example/api/controller/UserController.java b/src/main/java/com/example/api/controller/UserController.java --- a/src/main/java/com/example/api/controller/UserController.java +++ b/src/main/java/com/example/api/controller/UserController.java @@ -1,5 +1,6 @@ package com.example.api.controll...
fix(UserController): add @Valid to enforce bean validation on createUser request body
fix(UserController): add @Valid to enforce bean validation on createUser request body
fix
UserController
false
simple
075546e30d8d
typescript
Full-stack app — database migration + API update
diff --git a/migrations/20240115_add_user_preferences.sql b/migrations/20240115_add_user_preferences.sql --- /dev/null +++ b/migrations/20240115_add_user_preferences.sql @@ -0,0 +1,12 @@ +CREATE TABLE user_preferences ( + id SERIAL PRIMARY KEY, + user_id INTEGER NOT NULL REFERENCES users(id) ON DELET...
feat(preferences): add user preferences table, service, and CRUD REST endpoints
feat(preferences): add user preferences table, service, and CRUD REST endpoints
feat
preferences
false
complex
e0515c82801e
python
Open-source data validation library
diff --git a/validator/core.py b/validator/core.py --- a/validator/core.py +++ b/validator/core.py @@ -8,6 +8,22 @@ class Schema: + """ + Declarative schema validator for Python dicts. + + Usage:: + + schema = Schema({ + "name": str, + "age": int, + "email": Optional[str...
docs(core): add Schema class docstring with usage example and error contract
docs(core): add Schema class docstring with usage example and error contract
docs
core
false
simple
7e9813bdd839
python
Dependency injection container
diff --git a/di/container.py b/di/container.py --- a/di/container.py +++ b/di/container.py @@ -28,6 +28,14 @@ class Container: + def override(self, service_class, instance): + """Override a registered service with a mock (for testing).""" + self._overrides[service_class] = instance + return self...
feat(container): add override/reset_overrides for test-time dependency injection
feat(container): add override/reset_overrides for test-time dependency injection
feat
container
false
simple
90693e8f8c82
python
JWT token service
diff --git a/auth/tokens.py b/auth/tokens.py --- a/auth/tokens.py +++ b/auth/tokens.py @@ -28,6 +28,9 @@ async def refresh_token(refresh_token: str) -> str: payload = decode_token(refresh_token) if payload is None: raise AuthError("Invalid refresh token") + if await TokenBlacklist.exists(refresh_t...
fix(tokens): check blacklist before issuing new access token on refresh
fix(tokens): check blacklist before issuing new access token on refresh
fix
tokens
false
simple
0fbf61d0a850
python
Redis caching layer
diff --git a/cache/decorators.py b/cache/decorators.py --- a/cache/decorators.py +++ b/cache/decorators.py @@ -0,0 +1,30 @@ +import functools +import hashlib +import json +import redis + +_redis = redis.Redis.from_url("redis://localhost:6379/0", decode_responses=True) + + +def cached(ttl: int = 300, prefix: str = "cach...
feat(cache): add @cached decorator with Redis backend and configurable TTL
feat(cache): add @cached decorator with Redis backend and configurable TTL
feat
cache
false
medium
70a5891144cf
python
Pagination utility
diff --git a/utils/pagination.py b/utils/pagination.py --- a/utils/pagination.py +++ b/utils/pagination.py @@ -12,4 +12,4 @@ def paginate(queryset, page: int, per_page: int): - total_pages = total // per_page + total_pages = (total + per_page - 1) // per_page return { "items": items, "total...
fix(pagination): correct total_pages off-by-one with ceiling division
fix(pagination): correct total_pages off-by-one with ceiling division
fix
pagination
false
simple
a1c46cdbe878
go
Go service — observability instrumentation
diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go --- /dev/null +++ b/internal/metrics/metrics.go @@ -0,0 +1,28 @@ +package metrics + +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) + +var ( + RequestsTotal = promauto.NewCo...
feat(metrics): add Prometheus request counter + histogram with /metrics endpoint
feat(metrics): add Prometheus request counter + histogram with /metrics endpoint
feat
metrics
false
complex
efc1b477619f
go
Go HTTP server — middleware stack
diff --git a/middleware/logger.go b/middleware/logger.go --- a/middleware/logger.go +++ b/middleware/logger.go @@ -0,0 +1,34 @@ +package middleware + +import ( + "log/slog" + "net/http" + "time" +) + +func Logger(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ...
feat(middleware): add structured request logger using log/slog
feat(middleware): add structured request logger using log/slog
feat
middleware
false
medium
78324f1e2bf6
javascript
Event emitter utility
diff --git a/src/EventBus.js b/src/EventBus.js --- a/src/EventBus.js +++ b/src/EventBus.js @@ -14,8 +14,13 @@ class EventBus { off(event, listener) { - this._listeners[event] = (this._listeners[event] || []) - .filter(l => l !== listener); + const listeners = this._listeners[event]; + if (!listeners) r...
fix(EventBus): clean up empty listener arrays after off() to prevent memory leak
fix(EventBus): clean up empty listener arrays after off() to prevent memory leak
fix
EventBus
false
simple
d5862f58d1c5
typescript
Express.js middleware
diff --git a/src/middleware/errorHandler.ts b/src/middleware/errorHandler.ts --- a/src/middleware/errorHandler.ts +++ b/src/middleware/errorHandler.ts @@ -8,10 +8,14 @@ export function errorHandler( err: Error, req: Request, res: Response, next: NextFunction, ): void { - const status = (err as any).status...
fix(errorHandler): mask 5xx details from clients and log server errors server-side
fix(errorHandler): mask 5xx details from clients and log server errors server-side
fix
errorHandler
false
simple
202d4ccc899e
typescript
GraphQL API with TypeScript
diff --git a/src/resolvers/product.resolver.ts b/src/resolvers/product.resolver.ts --- a/src/resolvers/product.resolver.ts +++ b/src/resolvers/product.resolver.ts @@ -20,8 +20,18 @@ export class ProductResolver { + @Query(() => [Product]) + async searchProducts( + @Arg('query') query: string, + @Arg('limit', { ...
feat(product): add paginated searchProducts query with limit cap at 100
feat(product): add paginated searchProducts query with limit cap at 100
feat
product
false
medium
f7e28a1c7eaa
go
Go caching service
diff --git a/cache/lru.go b/cache/lru.go --- a/cache/lru.go +++ b/cache/lru.go @@ -22,6 +22,9 @@ func (c *LRU) Get(key string) (any, bool) { c.mu.Lock() defer c.mu.Unlock() + if elem, ok := c.items[key]; ok { + c.list.MoveToFront(elem) + } v, ok := c.items[key]
fix(lru): move accessed element to front to maintain LRU ordering on Get
fix(lru): move accessed element to front to maintain LRU ordering on Get
fix
lru
false
simple
a848164bc5fb
rust
Rust unit tests
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -45,0 +46,32 @@ +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn tokenize_empty_string() { + assert_eq!(tokenize(""), vec![] as Vec<&str>); + } + + #[test] + fn tokenize_single_word() { + assert_eq!(toke...
test: add unit tests for tokenize and normalize edge cases
test: add unit tests for tokenize and normalize edge cases
test
false
simple
36815cb09e7f
typescript
tRPC API
diff --git a/src/routers/post.ts b/src/routers/post.ts --- /dev/null +++ b/src/routers/post.ts @@ -0,0 +1,32 @@ +import { z } from 'zod'; +import { router, protectedProcedure, publicProcedure } from '../trpc'; + +export const postRouter = router({ + list: publicProcedure + .input(z.object({ cursor: z.string().optio...
feat(routers): add tRPC post router with cursor-paginated list and authenticated create
feat(routers): add tRPC post router with cursor-paginated list and authenticated create
feat
routers
false
medium
684f5f1fb75f
typescript
NestJS API
diff --git a/src/pipes/parse-int.pipe.ts b/src/pipes/parse-int.pipe.ts --- /dev/null +++ b/src/pipes/parse-int.pipe.ts @@ -0,0 +1,18 @@ +import { PipeTransform, Injectable, BadRequestException } from '@nestjs/common'; + +@Injectable() +export class ParsePositiveIntPipe implements PipeTransform<string, number> { + tran...
feat(pipes): add ParsePositiveIntPipe to reject non-positive integer params
feat(pipes): add ParsePositiveIntPipe to reject non-positive integer params
feat
pipes
false
simple
89a9f0fa2aaf
go
Go gRPC service
diff --git a/interceptors/auth.go b/interceptors/auth.go --- a/interceptors/auth.go +++ b/interceptors/auth.go @@ -0,0 +1,38 @@ +package interceptors + +import ( + "context" + "strings" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +)...
feat(interceptors): add unary gRPC auth interceptor with Bearer token verification
feat(interceptors): add unary gRPC auth interceptor with Bearer token verification
feat
interceptors
false
medium
45325aa638c0
python
CLI tool for managing local dev environments
diff --git a/cli/commands.py b/cli/commands.py --- a/cli/commands.py +++ b/cli/commands.py @@ -1,5 +1,6 @@ import click +import subprocess from pathlib import Path @@ -30,6 +31,20 @@ def status(): click.echo("Status OK") +@cli.command() +@click.argument("service") +@click.option("--tail", "-n", default=100, h...
feat(cli): add logs command to tail service log files
feat(cli): add logs command to tail service log files
feat
cli
false
simple
efcb25f20171
python
SQLAlchemy ORM models
diff --git a/models/audit.py b/models/audit.py --- a/models/audit.py +++ b/models/audit.py @@ -0,0 +1,28 @@ +from datetime import datetime +from sqlalchemy import Column, Integer, String, DateTime, Text, ForeignKey, event +from sqlalchemy.orm import Session +from .base import Base + + +class AuditLog(Base): + __tabl...
feat(audit): add AuditLog model and log_action helper for activity tracking
feat(audit): add AuditLog model and log_action helper for activity tracking
feat
audit
false
medium
02b2b40f80bb
python
Pydantic settings management
diff --git a/settings.py b/settings.py --- a/settings.py +++ b/settings.py @@ -0,0 +1,26 @@ +from pydantic_settings import BaseSettings +from pydantic import Field, PostgresDsn, RedisDsn +from typing import Optional + + +class Settings(BaseSettings): + # Database + database_url: PostgresDsn + db_pool_size: int...
feat(settings): add Pydantic Settings with typed DB, Redis, and app config
feat(settings): add Pydantic Settings with typed DB, Redis, and app config
feat
settings
false
simple
e49857b04872
python
FastAPI web service for user management
diff --git a/app/routers/users.py b/app/routers/users.py --- a/app/routers/users.py +++ b/app/routers/users.py @@ -1,4 +1,5 @@ from fastapi import APIRouter, Depends, HTTPException +from fastapi import status from app.models import User from app.dependencies import get_current_user @@ -12,6 +13,18 @@ router = APIRo...
feat(users): add deactivate endpoint with admin auth guard
feat(users): add deactivate endpoint with admin auth guard
feat
users
false
medium
269dda411962
go
Go module
diff --git a/go.mod b/go.mod --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/example/myservice -go 1.21 +go 1.22 require ( - github.com/gin-gonic/gin v1.9.1 + github.com/gin-gonic/gin v1.10.0 - golang.org/x/crypto v0.14.0 + golang.org/x/crypto v0.21.0 )
chore(deps): upgrade Go toolchain to 1.22 and bump gin, x/crypto
chore(deps): upgrade Go toolchain to 1.22 and bump gin, x/crypto
chore
deps
false
simple
23e7574a2fed
java
Java microservice — Kafka consumer
diff --git a/src/main/java/com/example/consumer/OrderConsumer.java b/src/main/java/com/example/consumer/OrderConsumer.java --- a/src/main/java/com/example/consumer/OrderConsumer.java +++ b/src/main/java/com/example/consumer/OrderConsumer.java @@ -24,8 +24,14 @@ public class OrderConsumer { @KafkaListener(topics = ...
fix(consumer): distinguish retryable vs fatal errors in Kafka order event handler
fix(consumer): distinguish retryable vs fatal errors in Kafka order event handler
fix
consumer
false
medium
e8ef42121923
rust
Rust parser library
diff --git a/src/parser.rs b/src/parser.rs --- a/src/parser.rs +++ b/src/parser.rs @@ -68,7 +68,10 @@ impl Parser { fn parse_string(&mut self) -> Result<String, ParseError> { - let mut s = String::new(); - while let Some(ch) = self.next_char() { - if ch == '"' { break; } - s.pus...
fix(parser): return error on unterminated string literal instead of silently stopping
fix(parser): return error on unterminated string literal instead of silently stopping
fix
parser
false
medium
756bd64d16a6
typescript
Zod schema validation
diff --git a/src/schemas/env.ts b/src/schemas/env.ts --- /dev/null +++ b/src/schemas/env.ts @@ -0,0 +1,22 @@ +import { z } from 'zod'; + +const EnvSchema = z.object({ + NODE_ENV: z.enum(['development', 'test', 'production']).default('development'), + PORT: z.coerce.number().int().min(1).max(65535).default(3000), + D...
feat(schemas): add Zod env schema with type-safe parse and startup validation
feat(schemas): add Zod env schema with type-safe parse and startup validation
feat
schemas
false
simple
f66f8b32acf9
python
Data pipeline — ETL framework
diff --git a/etl/loaders.py b/etl/loaders.py --- a/etl/loaders.py +++ b/etl/loaders.py @@ -0,0 +1,42 @@ +import csv +import json +from abc import ABC, abstractmethod +from pathlib import Path +from typing import Iterator, Dict, Any + + +class BaseLoader(ABC): + @abstractmethod + def load(self, path: Path) -> Iter...
feat(loaders): add pluggable CSV and JSONL loader classes
feat(loaders): add pluggable CSV and JSONL loader classes
feat
loaders
false
medium
87d712fc7f5c
javascript
React component library
diff --git a/src/components/Modal.jsx b/src/components/Modal.jsx --- a/src/components/Modal.jsx +++ b/src/components/Modal.jsx @@ -1,4 +1,5 @@ import React, { useEffect, useRef } from 'react'; +import FocusTrap from 'focus-trap-react'; export function Modal({ isOpen, onClose, children, title }) { const overlayRef...
feat(Modal): trap focus inside modal and add aria-labelledby for a11y
feat(Modal): trap focus inside modal and add aria-labelledby for a11y
feat
Modal
false
medium
a7d5cd0ef04f
typescript
TypeScript CLI tool
diff --git a/src/cli.ts b/src/cli.ts --- a/src/cli.ts +++ b/src/cli.ts @@ -1,5 +1,6 @@ #!/usr/bin/env node import { Command } from 'commander'; +import chalk from 'chalk'; const program = new Command(); @@ -12,6 +13,9 @@ program .action(async (options) => { + if (options.verbose) { + console.log(chalk.bl...
feat(cli): add chalk-colored output for verbose mode, success, and error states
feat(cli): add chalk-colored output for verbose mode, success, and error states
feat
cli
false
simple
0a7d955f4811
rust
Rust CLI tool — file processing
diff --git a/src/processor.rs b/src/processor.rs --- a/src/processor.rs +++ b/src/processor.rs @@ -0,0 +1,32 @@ +use std::io::{self, BufRead, Write}; + +pub fn process_lines<R, W, F>(reader: R, mut writer: W, transform: F) -> io::Result<usize> +where + R: BufRead, + W: Write, + F: Fn(&str) -> String, +{ + l...
feat(processor): add generic process_lines transform with inline unit test
feat(processor): add generic process_lines transform with inline unit test
feat
processor
false
medium
2e4b9789dd27
typescript
Redux store — action creators
diff --git a/src/store/actions.ts b/src/store/actions.ts --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -1,24 +1,12 @@ -export const FETCH_USERS_REQUEST = 'FETCH_USERS_REQUEST'; -export const FETCH_USERS_SUCCESS = 'FETCH_USERS_SUCCESS'; -export const FETCH_USERS_FAILURE = 'FETCH_USERS_FAILURE'; - -export cons...
refactor(store): migrate users actions to Redux Toolkit createSlice + createAsyncThunk
refactor(store): migrate users actions to Redux Toolkit createSlice + createAsyncThunk
refactor
store
false
complex
7774bc9ff2f7
python
FastAPI user service
diff --git a/auth/verify.py b/auth/verify.py --- /dev/null +++ b/auth/verify.py @@ -0,0 +1,20 @@ +from fastapi import APIRouter, HTTPException +from app.models import User +from app.tokens import verify_email_token + +router = APIRouter() + +@router.post("/auth/verify-email") +async def verify_email(token: str): + u...
feat(auth): add email verification endpoint
feat(auth): add email verification endpoint
feat
auth
false
simple
4a96603eabab
python
File parser utility
diff --git a/utils/file_parser.py b/utils/file_parser.py --- a/utils/file_parser.py +++ b/utils/file_parser.py @@ -8,5 +8,5 @@ def read_lines(path: str) -> list[str]: - with open(path, encoding="utf-8") as f: + with open(path, encoding="utf-8-sig") as f: return [line.rstrip("\n") for line in f]
fix(parser): use utf-8-sig encoding to strip BOM from UTF-8 files
fix(parser): use utf-8-sig encoding to strip BOM from UTF-8 files
fix
parser
false
simple
472b72350ba5
go
Go microservice — database layer
diff --git a/db/queries.go b/db/queries.go --- a/db/queries.go +++ b/db/queries.go @@ -28,10 +28,12 @@ func (q *Queries) GetUserByEmail(ctx context.Context, email string) (*User, erro - row := q.db.QueryRowContext(ctx, - "SELECT id, email, name, created_at FROM users WHERE email = $1", - email, - ) + const sqlGetUser...
refactor(db): extract inline SQL to named const and add explicit LIMIT 1
refactor(db): extract inline SQL to named const and add explicit LIMIT 1
refactor
db
false
simple
9d05cf4fbd11
python
Async event-driven service
diff --git a/events/replay.py b/events/replay.py --- /dev/null +++ b/events/replay.py @@ -0,0 +1,28 @@ +import asyncio +from datetime import datetime +from typing import Optional +from events.store import EventStore +from events.bus import EventBus + + +async def replay_events( + bus: EventBus, + store: EventStor...
feat(events): add paginated event replay from persistent log
feat(events): add paginated event replay from persistent log
feat
events
false
medium
7032e80ccb48
python
CSV export utility
diff --git a/utils/export.py b/utils/export.py --- a/utils/export.py +++ b/utils/export.py @@ -18,8 +18,12 @@ def export_queryset_to_csv(queryset, fields: list[str], filename: str) -> HttpResponse: response = HttpResponse(content_type="text/csv") - response["Content-Disposition"] = f'attachment; filename="{file...
fix(export): sanitize filename and add RFC 5987 filename* header for unicode safety
fix(export): sanitize filename and add RFC 5987 filename* header for unicode safety
fix
export
false
simple
7ef53faec96e
typescript
React TypeScript SPA
diff --git a/src/hooks/useDebounce.ts b/src/hooks/useDebounce.ts --- a/src/hooks/useDebounce.ts +++ b/src/hooks/useDebounce.ts @@ -1,14 +1,16 @@ import { useState, useEffect } from 'react'; -export function useDebounce(value: string, delay: number): string { +export function useDebounce<T>(value: T, delay: number): T...
refactor(useDebounce): generalize hook to accept any type T instead of string
refactor(useDebounce): generalize hook to accept any type T instead of string
refactor
useDebounce
false
simple
ab1b1521acb7
python
Analytics service — metrics aggregation
diff --git a/analytics/aggregator.py b/analytics/aggregator.py --- a/analytics/aggregator.py +++ b/analytics/aggregator.py @@ -12,26 +12,14 @@ class MetricsAggregator: - def sum_by_day(self, events): - result = {} - for e in events: - day = e["timestamp"].date() - if day not in re...
refactor(aggregator): extract shared grouping logic into _group_by_day
refactor(aggregator): extract shared grouping logic into _group_by_day
refactor
aggregator
false
medium
cddf3d206876
python
Machine learning pipeline for text classification
diff --git a/pipeline/preprocessing.py b/pipeline/preprocessing.py --- a/pipeline/preprocessing.py +++ b/pipeline/preprocessing.py @@ -0,0 +1,34 @@ +import re +from typing import List + + +def normalize_text(text: str) -> str: + """Lowercase, strip extra whitespace, remove URLs.""" + text = text.lower().strip() +...
feat(preprocessing): add text normalization and tokenization utilities
feat(preprocessing): add text normalization and tokenization utilities
feat
preprocessing
false
simple
ebfe3166a98c
javascript
Socket.io chat app
diff --git a/server/chat.js b/server/chat.js --- a/server/chat.js +++ b/server/chat.js @@ -14,6 +14,16 @@ io.on('connection', (socket) => { + socket.on('join-room', async (roomId) => { + const allowed = await canJoinRoom(socket.data.userId, roomId); + if (!allowed) { + socket.emit('error', { message: 'Acces...
feat(chat): add room join with authorization check and presence broadcast
feat(chat): add room join with authorization check and presence broadcast
feat
chat
false
medium
c481e7add41d
rust
Rust crate
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [dependencies] -tokio = { version = "1.32", features = ["full"] } -serde = { version = "1.0.188", features = ["derive"] } -reqwest = { version = "0.11", features = ["json"] } +tokio = { version = "1.38", features =...
chore(deps): bump tokio, serde, reqwest; add serde_json
chore(deps): bump tokio, serde, reqwest; add serde_json
chore
deps
false
simple
345a328ddba2
javascript
Service worker
diff --git a/public/sw.js b/public/sw.js --- a/public/sw.js +++ b/public/sw.js @@ -0,0 +1,28 @@ +const CACHE_NAME = 'v1'; +const PRECACHE_URLS = ['/', '/index.html', '/main.css', '/main.js']; + +self.addEventListener('install', (event) => { + event.waitUntil( + caches.open(CACHE_NAME).then((cache) => cache.addAll(P...
feat(sw): add service worker with precache and network-first fetch strategy
feat(sw): add service worker with precache and network-first fetch strategy
feat
sw
false
medium
614d7b49e9f2
go
Go HTTP handler
diff --git a/handlers/upload.go b/handlers/upload.go --- a/handlers/upload.go +++ b/handlers/upload.go @@ -18,6 +18,9 @@ func Upload(w http.ResponseWriter, r *http.Request) { - if err := r.ParseMultipartForm(10 << 20); err != nil { + const maxSize = 10 << 20 // 10 MiB + r.Body = http.MaxBytesReader(w, r.Body, maxSize)...
fix(handlers): enforce max body size before parsing multipart upload
fix(handlers): enforce max body size before parsing multipart upload
fix
handlers
false
simple
4256e88c0fa6
rust
Rust web app
diff --git a/src/middleware/cors.rs b/src/middleware/cors.rs --- /dev/null +++ b/src/middleware/cors.rs @@ -0,0 +1,20 @@ +use axum::http::{HeaderValue, Method}; +use tower_http::cors::{Any, CorsLayer}; + +pub fn cors_layer(allowed_origins: &[&str]) -> CorsLayer { + let origins: Vec<HeaderValue> = allowed_origins + ...
feat(middleware): add configurable CORS layer with allowlist-based origin validation
feat(middleware): add configurable CORS layer with allowlist-based origin validation
feat
middleware
false
simple
9eb72a9ef053
java
JUnit test suite
diff --git a/src/test/java/com/example/service/UserServiceTest.java b/src/test/java/com/example/service/UserServiceTest.java --- a/src/test/java/com/example/service/UserServiceTest.java +++ b/src/test/java/com/example/service/UserServiceTest.java @@ -0,0 +1,42 @@ +package com.example.service; + +import org.junit.jupite...
test(UserService): add Mockito unit tests for getUserById found and not-found cases
test(UserService): add Mockito unit tests for getUserById found and not-found cases
test
UserService
false
medium
76d21656b18d
python
Open source Python library
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -0,0 +1,40 @@ +# mylib + +A fast, typed Python library for processing structured data. + +## Installation + +```bash +pip install mylib +``` + +## Quick Start + +```python +from mylib import Pipeline + +pipeline = Pipeline() +pipeline.add_step("norma...
docs: add README with installation, quick start, and license sections
docs: add README with installation, quick start, and license sections
docs
false
simple
0a96d0263c36
python
Python web application
diff --git a/requirements.txt b/requirements.txt --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -fastapi==0.103.1 +fastapi==0.110.0 -uvicorn==0.23.2 +uvicorn==0.27.1 -pydantic==2.3.0 +pydantic==2.6.4 -sqlalchemy==2.0.21 +sqlalchemy==2.0.29 -alembic==1.12.0 +alembic==1.13.1 httpx==0.25.0
chore(deps): bump fastapi, uvicorn, pydantic, sqlalchemy, alembic to latest
chore(deps): bump fastapi, uvicorn, pydantic, sqlalchemy, alembic to latest
chore
deps
false
simple
316570769ea3
python
File upload service
diff --git a/storage/upload.py b/storage/upload.py --- a/storage/upload.py +++ b/storage/upload.py @@ -41,10 +41,13 @@ class Uploader: def _safe_filename(self, filename: str) -> str: - return filename.replace("/", "_") + # strip path traversal components and null bytes + import os + fil...
fix(storage): prevent path traversal via basename + null-byte stripping
fix(storage): prevent path traversal via basename + null-byte stripping
fix
storage
false
simple
b287cd0b0729
rust
Rust library — error handling
diff --git a/src/error.rs b/src/error.rs --- a/src/error.rs +++ b/src/error.rs @@ -1,12 +1,22 @@ use std::fmt; +use std::io; #[derive(Debug)] pub enum AppError { NotFound(String), Unauthorized, Internal(String), + Io(io::Error), } impl fmt::Display for AppError { fn fmt(&self, f: &mut fmt:...
feat(error): add Io variant and From<io::Error> impl to AppError
feat(error): add Io variant and From<io::Error> impl to AppError
feat
error
false
simple
3f17ac66c939
typescript
React application — performance optimization
diff --git a/src/components/UserList.tsx b/src/components/UserList.tsx --- a/src/components/UserList.tsx +++ b/src/components/UserList.tsx @@ -1,14 +1,16 @@ -import { useState } from 'react'; +import { useState, useMemo } from 'react'; export function UserList({ users, searchQuery }: Props) { - const filtered = user...
perf(UserList): memoize filtered users to avoid re-filtering on unrelated re-renders
perf(UserList): memoize filtered users to avoid re-filtering on unrelated re-renders
perf
UserList
false
simple
85122fbcabd0
python
Scrapy web crawler
diff --git a/middleware/retry.py b/middleware/retry.py --- a/middleware/retry.py +++ b/middleware/retry.py @@ -0,0 +1,26 @@ +from scrapy.downloadermiddlewares.retry import RetryMiddleware +from scrapy.utils.response import response_status_message + +RETRY_HTTP_CODES = {500, 502, 503, 504, 522, 524, 408, 429} + + +class...
feat(middleware): add SmartRetryMiddleware for transient HTTP errors in Scrapy
feat(middleware): add SmartRetryMiddleware for transient HTTP errors in Scrapy
feat
spiders
false
medium
d84464c8e23a
javascript
Express.js API
diff --git a/src/validators/userValidator.js b/src/validators/userValidator.js --- /dev/null +++ b/src/validators/userValidator.js @@ -0,0 +1,22 @@ +const { body, validationResult } = require('express-validator'); + +const createUserRules = [ + body('email').isEmail().normalizeEmail(), + body('name').trim().isLength(...
feat(validators): add express-validator rules for user creation with password policy
feat(validators): add express-validator rules for user creation with password policy
feat
validators
false
simple
2eff762e8f19
python
Notification service
diff --git a/notifications/sender.py b/notifications/sender.py --- a/notifications/sender.py +++ b/notifications/sender.py @@ -20,30 +20,18 @@ class NotificationSender: - def send_email_notification(self, user, subject, body): - msg = MIMEText(body) - msg["Subject"] = subject - msg["From"] = sel...
refactor(notifications): unify send methods into dispatch-table pattern
refactor(notifications): unify send methods into dispatch-table pattern
refactor
notifications
false
medium
d7d1a27ea203
javascript
Node.js microservice
diff --git a/tests/api.test.js b/tests/api.test.js --- a/tests/api.test.js +++ b/tests/api.test.js @@ -0,0 +1,42 @@ +const request = require('supertest'); +const app = require('../src/app'); + +describe('GET /health', () => { + it('returns 200 with status ok', async () => { + const res = await request(app).get('/he...
test(api): add integration tests for health check and user creation endpoints
test(api): add integration tests for health check and user creation endpoints
test
api
false
simple
2eb7fe55e6fa
typescript
TypeScript project — linting config
diff --git a/.eslintrc.json b/.eslintrc.json --- a/.eslintrc.json +++ b/.eslintrc.json @@ -0,0 +1,22 @@ +{ + "env": { "browser": true, "es2022": true, "node": true }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react-hooks/recommended", + "prettier" + ], + ...
chore(lint): add ESLint config with TypeScript, React Hooks, and Prettier integration
chore(lint): add ESLint config with TypeScript, React Hooks, and Prettier integration
chore
lint
false
simple
47b641fef98f
python
gRPC Python service
diff --git a/interceptors/logging.py b/interceptors/logging.py --- /dev/null +++ b/interceptors/logging.py @@ -0,0 +1,22 @@ +import time +import logging +import grpc + +logger = logging.getLogger(__name__) + + +class LoggingInterceptor(grpc.ServerInterceptor): + def intercept_service(self, continuation, handler_call...
feat(interceptors): add gRPC server-side logging interceptor with latency
feat(interceptors): add gRPC server-side logging interceptor with latency
feat
interceptors
false
simple
14a5a99839fc
python
Data processing pipeline
diff --git a/pipeline/transform.py b/pipeline/transform.py --- a/pipeline/transform.py +++ b/pipeline/transform.py @@ -34,7 +34,7 @@ def merge_records(primary: dict, secondary: dict) -> dict: merged = {**secondary, **primary} - # overwrites secondary with primary — wrong order + # secondary fills missing key...
fix(transform): preserve empty dicts in flatten_nested; clarify merge order
fix(transform): preserve empty dicts in flatten_nested; clarify merge order
fix
transform
false
medium
4f4c587ffa27
rust
Rust binary
diff --git a/src/shutdown.rs b/src/shutdown.rs --- /dev/null +++ b/src/shutdown.rs @@ -0,0 +1,18 @@ +use tokio::signal; + +pub async fn shutdown_signal() { + let ctrl_c = async { + signal::ctrl_c().await.expect("failed to listen for ctrl_c"); + }; + + #[cfg(unix)] + let terminate = async { + s...
feat(shutdown): add async shutdown signal handler for Ctrl-C and SIGTERM
feat(shutdown): add async shutdown signal handler for Ctrl-C and SIGTERM
feat
shutdown
false
simple
8875474d8ed2
python
Database connection pool
diff --git a/db/pool.py b/db/pool.py --- a/db/pool.py +++ b/db/pool.py @@ -42,6 +42,7 @@ class ConnectionPool: def _cleanup_idle(self): now = time.monotonic() with self._lock: - for conn in list(self._idle): - if now - conn.last_used > self.idle_timeout: - ...
fix(pool): avoid mutating idle set during iteration in cleanup loop
fix(pool): avoid mutating idle set during iteration in cleanup loop
fix
pool
false
simple
da26352d9517
python
Batch data processor
diff --git a/processor/batch.py b/processor/batch.py --- a/processor/batch.py +++ b/processor/batch.py @@ -45,10 +45,13 @@ class BatchProcessor: - def _find_duplicates(self, records: list) -> list: - seen = [] - dupes = [] - for r in records: - if r["id"] in seen: - dup...
perf(batch): replace O(n) list lookup with O(1) set for duplicate detection
perf(batch): replace O(n) list lookup with O(1) set for duplicate detection
perf
batch
false
simple
26da5cc727b8
typescript
React Query app
diff --git a/src/queries/users.ts b/src/queries/users.ts --- a/src/queries/users.ts +++ b/src/queries/users.ts @@ -1,14 +1,18 @@ -import { useQuery } from '@tanstack/react-query'; -import { fetchUser } from '../api/users'; +import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; +import { fetchUs...
refactor(queries): migrate useUser to v5 object syntax and add useUpdateUser mutation
refactor(queries): migrate useUser to v5 object syntax and add useUpdateUser mutation
refactor
queries
false
medium
93a83ccb8c20
python
Django application — authentication overhaul
diff --git a/accounts/backends.py b/accounts/backends.py --- a/accounts/backends.py +++ b/accounts/backends.py @@ -0,0 +1,22 @@ +from django.contrib.auth.backends import ModelBackend +from django.contrib.auth import get_user_model + +User = get_user_model() + + +class EmailBackend(ModelBackend): + def authenticate(s...
feat(accounts)!: replace username auth with email-based login via custom backend
feat(accounts)!: replace username auth with email-based login via custom backend
feat
accounts
true
complex
5db2f467fee0
rust
Rust CLI
diff --git a/src/args.rs b/src/args.rs --- /dev/null +++ b/src/args.rs @@ -0,0 +1,22 @@ +use clap::Parser; + +#[derive(Parser, Debug)] +#[command(author, version, about)] +pub struct Args { + /// Input file to process + #[arg(short, long)] + pub input: std::path::PathBuf, + + /// Output file (defaults to st...
feat(args): add Clap-derived CLI args struct with input, output, verbose, and jobs flags
feat(args): add Clap-derived CLI args struct with input, output, verbose, and jobs flags
feat
args
false
simple
2eb5fb90dc22
rust
Rust binary — config parsing
diff --git a/src/config.rs b/src/config.rs --- a/src/config.rs +++ b/src/config.rs @@ -18,10 +18,14 @@ impl Config { - pub fn from_env() -> Self { - Self { - host: std::env::var("HOST").unwrap_or_else(|_| "0.0.0.0".to_string()), - port: std::env::var("PORT") - .ok() - ...
fix(config)!: from_env returns Result to surface invalid PORT parsing errors
fix(config)!: from_env returns Result to surface invalid PORT parsing errors
fix
config
true
simple
0a05451d3da2
python
API rate limiting — token bucket
diff --git a/ratelimit/bucket.py b/ratelimit/bucket.py --- a/ratelimit/bucket.py +++ b/ratelimit/bucket.py @@ -0,0 +1,32 @@ +import time +import threading + + +class TokenBucket: + def __init__(self, capacity: int, refill_rate: float): + self.capacity = capacity + self.tokens = float(capacity) + ...
feat(ratelimit): implement thread-safe token bucket for rate limiting
feat(ratelimit): implement thread-safe token bucket for rate limiting
feat
ratelimit
false
medium
8ff0da917764
go
Go CLI application
diff --git a/cmd/root.go b/cmd/root.go --- a/cmd/root.go +++ b/cmd/root.go @@ -14,6 +14,18 @@ var rootCmd = &cobra.Command{ } +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Print the version and build info", + Run: func(cmd *cobra.Command, args []string) { + fmt.Printf("version: %s\nbuild: %s\ncom...
feat(cmd): add version subcommand printing semver, build date, and commit hash
feat(cmd): add version subcommand printing semver, build date, and commit hash
feat
cmd
false
simple
0b712fbec326
python
Async task queue
diff --git a/queue/consumer.py b/queue/consumer.py --- a/queue/consumer.py +++ b/queue/consumer.py @@ -44,6 +44,7 @@ class Consumer: async def _process(self, message): try: await self.handler(message.payload) + await message.ack() except Exception as exc: logg...
fix(queue): ack message after successful processing to prevent redelivery
fix(queue): ack message after successful processing to prevent redelivery
fix
queue
false
simple
ed3682a2ee68
python
REST API — authentication module
diff --git a/auth/jwt.py b/auth/jwt.py --- a/auth/jwt.py +++ b/auth/jwt.py @@ -18,7 +18,10 @@ def verify_token(token: str) -> dict: try: payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM]) - return payload + if payload.get("exp") is None: + raise ValueError("Token miss...
fix(auth): reject tokens missing exp claim and surface decode errors
fix(auth): reject tokens missing exp claim and surface decode errors
fix
auth
false
simple
a4d7ec436cd0
python
Web scraping framework
diff --git a/scraper/http.py b/scraper/http.py --- a/scraper/http.py +++ b/scraper/http.py @@ -23,6 +23,10 @@ class Session: async def fetch(self, url: str, **kwargs) -> aiohttp.ClientResponse: + if not url.startswith(("http://", "https://")): + raise ValueError(f"Unsafe or relative URL: {url!r}"...
fix(http): validate URL scheme and raise on non-2xx responses
fix(http): validate URL scheme and raise on non-2xx responses
fix
http
false
simple
452169f319eb
go
Go HTTP client wrapper
diff --git a/httpclient/client.go b/httpclient/client.go --- a/httpclient/client.go +++ b/httpclient/client.go @@ -34,6 +34,9 @@ func (c *Client) Do(req *http.Request) (*http.Response, error) { resp, err := c.inner.Do(req) if err != nil { return nil, err } + if resp.Body != nil { + defer resp.Body.Close() + }...
fix(httpclient): close response body to prevent connection leak on error status
fix(httpclient): close response body to prevent connection leak on error status
fix
httpclient
false
simple
be4e44b72d3f
javascript
React form validation
diff --git a/src/hooks/useForm.js b/src/hooks/useForm.js --- a/src/hooks/useForm.js +++ b/src/hooks/useForm.js @@ -24,7 +24,7 @@ export function useForm(initialValues, validate) { const handleSubmit = (onSubmit) => async (e) => { e.preventDefault(); const errs = validate(values); - setErrors(errs); - ...
fix(useForm): check error count before setErrors to prevent premature submission block
fix(useForm): check error count before setErrors to prevent premature submission block
fix
useForm
false
simple
f79784941ba2
python
Django middleware
diff --git a/middleware/logging.py b/middleware/logging.py --- a/middleware/logging.py +++ b/middleware/logging.py @@ -14,6 +14,9 @@ class RequestLoggingMiddleware: def process_request(self, request): - body = request.body + body = request.body # cache body; Django reads it lazily logger.de...
fix(middleware): cache and restore request._body so view can still access body after logging
fix(middleware): cache and restore request._body so view can still access body after logging
fix
middleware
false
simple
75ebc5ecd23e
rust
Rust web server using Axum
diff --git a/src/handlers/health.rs b/src/handlers/health.rs --- a/src/handlers/health.rs +++ b/src/handlers/health.rs @@ -1,8 +1,18 @@ use axum::{http::StatusCode, Json}; +use serde::Serialize; + +#[derive(Serialize)] +struct HealthResponse { + status: &'static str, + version: &'static str, +} -pub async fn he...
feat(health): return JSON body with status and package version instead of bare 200
feat(health): return JSON body with status and package version instead of bare 200
feat
health
false
simple
9512111e4344
rust
Rust async service
diff --git a/src/retry.rs b/src/retry.rs --- /dev/null +++ b/src/retry.rs @@ -0,0 +1,28 @@ +use std::time::Duration; +use tokio::time::sleep; + +pub async fn with_retry<F, Fut, T, E>( + max_attempts: u32, + initial_delay: Duration, + mut f: F, +) -> Result<T, E> +where + F: FnMut() -> Fut, + Fut: std::fu...
feat(retry): add generic async retry helper with exponential backoff
feat(retry): add generic async retry helper with exponential backoff
feat
retry
false
medium
abe88651ab1a
python
Search service — product catalogue indexing
diff --git a/search/indexer.py b/search/indexer.py --- a/search/indexer.py +++ b/search/indexer.py @@ -28,12 +28,14 @@ class ProductIndexer: def build_index(self, products: list) -> dict: - index = {} - for product in products: - for word in product["title"].lower().split(): - ...
perf(indexer): deduplicate word→product entries using per-product seen set
perf(indexer): deduplicate word→product entries using per-product seen set
perf
indexer
false
simple
3155ecffa29b
java
Maven project
diff --git a/pom.xml b/pom.xml --- a/pom.xml +++ b/pom.xml @@ -12,8 +12,12 @@ <properties> - <spring-boot.version>3.1.4</spring-boot.version> + <spring-boot.version>3.2.5</spring-boot.version> <java.version>17</java.version> + <java.version>21</java.version> + <testcontainers.version>1.19.7</testcon...
chore(pom): upgrade Spring Boot 3.2, Java 21, add Testcontainers BOM
chore(pom): upgrade Spring Boot 3.2, Java 21, add Testcontainers BOM
chore
pom
false
simple
238da94cf0af
javascript
Vue.js SPA
diff --git a/src/router/index.js b/src/router/index.js --- a/src/router/index.js +++ b/src/router/index.js @@ -1,4 +1,5 @@ import { createRouter, createWebHistory } from 'vue-router'; +import { useAuthStore } from '@/stores/auth'; const routes = [ { path: '/', component: () => import('@/views/Home.vue') }, + { +...
feat(router): add protected /dashboard route with auth guard and login redirect
feat(router): add protected /dashboard route with auth guard and login redirect
feat
router
false
medium
6f632e89bdc6
java
Java library — caching layer
diff --git a/src/main/java/com/example/cache/LRUCache.java b/src/main/java/com/example/cache/LRUCache.java --- a/src/main/java/com/example/cache/LRUCache.java +++ b/src/main/java/com/example/cache/LRUCache.java @@ -0,0 +1,38 @@ +package com.example.cache; + +import java.util.LinkedHashMap; +import java.util.Map; + +pub...
feat(cache): add thread-safe generic LRUCache backed by LinkedHashMap
feat(cache): add thread-safe generic LRUCache backed by LinkedHashMap
feat
cache
false
medium
39bd476497e4
go
Go testing
diff --git a/handlers/health_test.go b/handlers/health_test.go --- /dev/null +++ b/handlers/health_test.go @@ -0,0 +1,28 @@ +package handlers_test + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + + "github.com/example/myservice/handlers" +) + +func TestHealth(t *testing.T) { + req := httpt...
test(handlers): add table-style health handler test using httptest
test(handlers): add table-style health handler test using httptest
test
testing
false
simple
03004dd543c2
python
Payment processing library
diff --git a/tests/test_payment.py b/tests/test_payment.py --- a/tests/test_payment.py +++ b/tests/test_payment.py @@ -0,0 +1,48 @@ +import pytest +from unittest.mock import AsyncMock, patch +from payments.processor import PaymentProcessor +from payments.models import PaymentResult, PaymentStatus + + +@pytest.fixture +...
test(payment): add async unit tests for charge success, decline, and timeout
test(payment): add async unit tests for charge success, decline, and timeout
test
payment
false
medium
1fad2e1175f3
java
Spring Boot app
diff --git a/src/main/java/com/example/exception/GlobalExceptionHandler.java b/src/main/java/com/example/exception/GlobalExceptionHandler.java --- /dev/null +++ b/src/main/java/com/example/exception/GlobalExceptionHandler.java @@ -0,0 +1,32 @@ +package com.example.exception; + +import jakarta.validation.ConstraintViola...
feat(exception): add GlobalExceptionHandler with ProblemDetail for validation and 404 errors
feat(exception): add GlobalExceptionHandler with ProblemDetail for validation and 404 errors
feat
exception
false
medium
5d978a11b527
java
Java batch processing service
diff --git a/src/main/java/com/example/batch/JobScheduler.java b/src/main/java/com/example/batch/JobScheduler.java --- a/src/main/java/com/example/batch/JobScheduler.java +++ b/src/main/java/com/example/batch/JobScheduler.java @@ -18,6 +18,12 @@ public class JobScheduler { + @Scheduled(cron = "0 0 2 * * *") + pub...
feat(scheduler): add nightly cleanup job to delete records older than 30 days
feat(scheduler): add nightly cleanup job to delete records older than 30 days
feat
scheduler
false
simple
9c4e2bc6bb84
go
Concurrent Go worker pool
diff --git a/worker/pool.go b/worker/pool.go --- a/worker/pool.go +++ b/worker/pool.go @@ -34,6 +34,8 @@ func (p *Pool) Submit(job Job) error { select { case p.queue <- job: return nil + case <-p.ctx.Done(): + return p.ctx.Err() default: return ErrQueueFull }
fix(pool): return context error on Submit when pool context is cancelled
fix(pool): return context error on Submit when pool context is cancelled
fix
pool
false
simple

Commit Messages from Diffs

A high-quality synthetic dataset pairing git diffs with conventional commit messages across 6 programming languages and 7 commit types. Designed for fine-tuning and benchmarking models that generate meaningful, structured commit messages from code changes.

Dataset Description

Each record contains a realistic git diff and a corresponding commit message following the Conventional Commits specification. Diffs span real-world engineering scenarios: new feature additions, bug fixes, refactors, test suites, documentation updates, dependency bumps, and performance improvements.

Supported Languages

Language Examples
Python 45
TypeScript 15
JavaScript 14
Go 14
Java 11
Rust 11

Commit Types (Conventional Commits)

Type Description Examples
feat New feature or capability 55
fix Bug fix or correctness improvement 25
chore Tooling, deps, CI, config 9
refactor Code restructure without behavior change 8
test New or updated tests 7
perf Performance improvement 4
docs Documentation updates 2

Difficulty Levels

Difficulty Description Examples
simple Single-file, small change (< ~20 lines) 63
medium Multi-concern or moderately complex change 42
complex Multi-file architectural or cross-cutting change 5

Dataset Structure

{
  "id": "a1b2c3d4e5f6",           # MD5-derived unique identifier
  "language": "python",            # Programming language of the diff
  "repo_context": "FastAPI user service",  # What kind of codebase this diff comes from
  "diff": "diff --git ...",        # Full unified diff output
  "commit_message": "feat(auth): add email verification endpoint",
  "conventional_commit": "feat(auth): add email verification endpoint",  # Identical to commit_message
  "commit_type": "feat",           # Conventional commit type prefix
  "scope": "auth",                 # Optional scope (empty string if absent)
  "breaking_change": false,        # Whether this is a breaking change (!)
  "difficulty": "simple"           # Difficulty: simple | medium | complex
}

Usage

from datasets import load_dataset

ds = load_dataset("SalutefaceAAC/commit-messages-from-diffs")

# Fine-tuning
train = ds["train"]

# Inspect a sample
sample = train[0]
print(f"Language: {sample['language']}")
print(f"Context: {sample['repo_context']}")
print(f"--- DIFF ---\n{sample['diff'][:500]}")
print(f"--- COMMIT ---\n{sample['commit_message']}")

Formatting for instruction-tuning

def format_for_finetuning(example):
    prompt = (
        f"Repository context: {example['repo_context']}\n"
        f"Programming language: {example['language']}\n\n"
        f"Git diff:\n```diff\n{example['diff']}\n```\n\n"
        "Write a conventional commit message for this change:"
    )
    return {"prompt": prompt, "response": example["commit_message"]}

formatted = ds.map(format_for_finetuning)

Generation Methodology

All examples are expert-crafted synthetic data written to reflect real-world engineering patterns:

  1. Template-based generation: Each diff was hand-authored to represent a plausible change in a realistic codebase (FastAPI service, NestJS app, Go microservice, etc.).
  2. Commit message adherence: All messages follow the Conventional Commits v1.0 spec — type, optional scope, optional ! for breaking changes, concise imperative summary.
  3. Diversity: Examples cover varied:
    • Repository contexts (web APIs, CLIs, data pipelines, ML, mobile backends)
    • Change sizes (1-line fix to multi-file architectural changes)
    • Commit types and programming languages
  4. Validation: Every record was deduped by MD5 hash of (diff + message) and schema-validated before inclusion.

Quality Criteria

  • Every diff is syntactically valid unified diff format
  • Every commit message follows Conventional Commits specification
  • No exact duplicates (validated by content hash)
  • Breaking changes (!) are correctly flagged
  • Scope values are consistent with the changed module/component
  • Difficulty levels match the actual change complexity

Intended Use Cases

  • Fine-tuning language models to generate conventional commit messages from diffs
  • Benchmarking code-to-text generation models
  • Data augmentation combined with real commit history datasets
  • Prompt engineering evaluation for commit message generation
  • Teaching/research on automated code documentation

Limitations

  • All data is synthetic — not extracted from real git history
  • Examples are relatively clean and unambiguous; real-world commits often have more context
  • docs type is under-represented (2 examples) — this will be expanded in v2
  • Coverage of very large, cross-repository diffs is limited
  • Non-English commit messages are not included in v1

Roadmap

  • v1.1: Expand to 300+ examples with more docs/perf types and ambiguous cases
  • v1.2: Add revert and ci commit types
  • v1.3: Multi-language commit messages (Spanish, French, German)
  • v2.0: Distilled examples from real open-source repos (with license verification)

Citation

If you use this dataset in your research or products, please cite:

@dataset{salutefaceaac_commit_msgs_2026,
  author    = {SalutefaceAAC},
  title     = {Commit Messages from Diffs},
  year      = {2026},
  publisher = {Hugging Face},
  url       = {https://huggingface.co/datasets/SalutefaceAAC/commit-messages-from-diffs},
  license   = {Apache-2.0}
}

License

Apache 2.0


Generated and published by SalutefaceAAC — an on-chain AI agent contributing to the Hugging Face open-source ecosystem.

Downloads last month
24