-
Notifications
You must be signed in to change notification settings - Fork 75
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
chore: make all jobs params mandatory #14642
Conversation
📝 WalkthroughWalkthroughThe changes simplify how variables are retrieved in the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
backend/src/Designer/Scheduling/DeploymentPipelinePollingJob.cs (1)
35-38
: 🛠️ Refactor suggestionApply consistent validation for all job parameters.
While making parameters mandatory, ensure consistent validation across all parameters. Currently, only
buildId
usesGuard.ArgumentNotNull
.Suggested approach to validate all parameters consistently:
- string org = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.Org); - string app = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.App); - string developer = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.Developer); - var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, app, developer); - string buildId = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.BuildId); - Guard.ArgumentNotNull(buildId, nameof(buildId)); + string org = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.Org); + Guard.ArgumentNotNullOrEmpty(org, nameof(DeploymentPipelinePollingJobConstants.Arguments.Org)); + + string app = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.App); + Guard.ArgumentNotNullOrEmpty(app, nameof(DeploymentPipelinePollingJobConstants.Arguments.App)); + + string developer = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.Developer); + Guard.ArgumentNotNullOrEmpty(developer, nameof(DeploymentPipelinePollingJobConstants.Arguments.Developer)); + + var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, app, developer); + + string buildId = context.JobDetail.JobDataMap.GetString(DeploymentPipelinePollingJobConstants.Arguments.BuildId); + Guard.ArgumentNotNullOrEmpty(buildId, nameof(DeploymentPipelinePollingJobConstants.Arguments.BuildId));Also applies to: 42-42
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
backend/src/Designer/Scheduling/DeploymentPipelinePollingJob.cs
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
backend/src/Designer/Scheduling/DeploymentPipelinePollingJob.cs (1)
Learnt from: mirkoSekulic
PR: Altinn/altinn-studio#14627
File: backend/src/Designer/Scheduling/DeploymentPipelinePollingJob.cs:35-41
Timestamp: 2025-02-11T13:27:52.832Z
Learning: In the DeploymentPipelinePollingJob, validation of environment and pipeline type parameters is intentionally lenient to support already running tasks, with plans to strengthen validation in future iterations.
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: Run dotnet build and test (macos-latest)
- GitHub Check: Build environment and run e2e test
- GitHub Check: Run dotnet build and test (windows-latest)
- GitHub Check: Run integration tests against actual gitea and db
- GitHub Check: Run dotnet build and test (ubuntu-latest)
- GitHub Check: Analyze
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
backend/src/Designer/Controllers/RepositoryController.cs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: Build environment and run e2e test
- GitHub Check: Run dotnet build and test (macos-latest)
- GitHub Check: Run dotnet build and test (windows-latest)
- GitHub Check: Analyze
- GitHub Check: Run dotnet build and test (ubuntu-latest)
- GitHub Check: Run integration tests against actual gitea and db
Description
Related Issue(s)
Verification
Documentation
Summary by CodeRabbit