Skip to content

docs(jobnik): add comprehensive zero-to-hero usage guide#48

Open
ronenkapelian wants to merge 1 commit intomasterfrom
add-jobnik-zero-to-hero
Open

docs(jobnik): add comprehensive zero-to-hero usage guide#48
ronenkapelian wants to merge 1 commit intomasterfrom
add-jobnik-zero-to-hero

Conversation

@ronenkapelian
Copy link
Contributor

Introduce a detailed usage guide for Jobnik to assist users in getting started effectively. This guide aims to enhance user experience and provide clear instructions for utilizing the features of Jobnik.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces comprehensive documentation for the Jobnik Job Management system, providing users with detailed guidance on how to integrate and use Jobnik in their distributed workflows. The documentation follows a "zero to hero" approach, covering everything from basic concepts to advanced patterns and best practices.

Changes:

  • Added a comprehensive 1,722-line usage guide covering Jobnik hierarchy, state transitions, data structures, producer/worker implementation, configuration, testing, and deployment
  • Added an 863-line best practices guide with recommendations for job design, type safety, worker implementation, concurrency, error handling, monitoring, and security
  • Created category configuration for organizing Jobnik guides in the documentation structure
  • Updated package-lock.json with peer dependency markers (standard npm operation)

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
package-lock.json Added peer: true markers to various dependency entries (standard npm peer dependency management)
docs/guides/jobnik/zero-to-hero.mdx Comprehensive step-by-step guide covering Jobnik fundamentals, architecture, implementation patterns, and deployment
docs/guides/jobnik/best-practices.mdx Best practices guide covering job design patterns, type safety, worker implementation, performance, error handling, monitoring, testing, and security
docs/guides/jobnik/_category_.json Category configuration file for organizing Jobnik documentation in the sidebar

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://MapColonies.github.io/infra-portal/pr-preview/pr-48/

Built to branch gh-pages at 2026-02-17 15:50 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

</TabItem>
</Tabs>

### Use Stage Names Meaningfully
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Use Stage Names Meaningfully
### Use Meaningful Stage Names

Comment on lines +60 to +77
Stage names should clearly indicate the type of work being performed.

```typescript
// Clear, descriptive stage names
await producer.createStage(jobId, {
type: 'validate-input',
data: { validationRules }
});

await producer.createStage(jobId, {
type: 'resize-images',
data: { dimensions }
});

await producer.createStage(jobId, {
type: 'upload-to-storage',
data: { bucket }
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would change for Good/Bad with one name

Comment on lines +121 to +163
```typescript
// Define strict types with required fields
export interface ImageProcessingJob {
'image-processing': {
data: {
uploadId: string;
userId: string;
sourceLocation: string;
targetLocation: string;
};
userMetadata: {
priority: 'HIGH' | 'MEDIUM' | 'LOW'; // Use unions for enums
uploadedAt: string; // ISO timestamp
};
};
}

export interface ImageStages {
'resize': {
data: {
readonly width: number; // Use readonly when appropriate
readonly height: number;
readonly quality: number;
readonly format: 'jpg' | 'png' | 'webp';
};
userMetadata: {
processedCount: number;
failedCount: number;
};
task: {
data: {
sourceUrl: string;
targetPath: string;
fileName: string;
};
userMetadata: {
attempts: number;
lastAttemptAt?: string;
};
};
};
}
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would try to make the examples shorter

}
```

### Version Your Types
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

}
```

### Use Structured Logging
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Comment on lines +816 to +818
- [ ] Environment variables are properly set
- [ ] Secrets are stored securely (not in config files)
- [ ] Connection URLs use HTTPS in production
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


### Code Quality
- [ ] All types are strictly defined
- [ ] Input validation implemented
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before, do we need this right now?

Comment on lines +829 to +834
### Observability
- [ ] Structured logging in place
- [ ] Custom metrics defined
- [ ] Distributed tracing enabled
- [ ] Health check endpoints exposed
- [ ] Alerts configured
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you get this from the boilerplate anyway

Comment on lines +837 to +841
- [ ] Unit tests cover core logic
- [ ] Integration tests validate workflow
- [ ] Load testing performed
- [ ] Failure scenarios tested
- [ ] Recovery mechanisms validated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have only one type of tests right now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be split. the start is more knowledge base, the structure of jobs/stage/tasks. the later parts are the actual zero to hero guides

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.

3 participants