-
Notifications
You must be signed in to change notification settings - Fork 11
feat: concurrency rule #579
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dea7b3e
feat: concurrency policy rule
adityachoudhari26 16b41eb
fomrat
adityachoudhari26 5e65216
fix
adityachoudhari26 050b8ab
add policy lock on evaluate release target
adityachoudhari26 d3e0cc9
fix buidl
adityachoudhari26 18944f6
fix types
adityachoudhari26 30eac4a
rabbit comments
adityachoudhari26 831dcd2
ui + tested
adityachoudhari26 ad19626
openapi
adityachoudhari26 1e63540
rabbit comments
adityachoudhari26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...ce/src/app/[workspaceSlug]/(app)/policies/[policyId]/edit/concurrency/EditConcurrency.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| "use client"; | ||
|
|
||
| import { Button } from "@ctrlplane/ui/button"; | ||
| import { | ||
| FormControl, | ||
| FormField, | ||
| FormItem, | ||
| FormMessage, | ||
| } from "@ctrlplane/ui/form"; | ||
| import { Input } from "@ctrlplane/ui/input"; | ||
|
|
||
| import { usePolicyFormContext } from "../_components/PolicyFormContext"; | ||
|
|
||
| export const EditConcurrency: React.FC = () => { | ||
| const { form } = usePolicyFormContext(); | ||
| return ( | ||
| <div className="space-y-6"> | ||
| <div className="max-w-xl space-y-1"> | ||
| <h2 className="text-lg font-semibold">Concurrency</h2> | ||
| <p className="text-sm text-muted-foreground"> | ||
| Control the number of concurrent deployments | ||
| </p> | ||
| </div> | ||
|
|
||
| <FormField | ||
| control={form.control} | ||
| name="concurrency" | ||
| render={({ field: { value, onChange } }) => ( | ||
| <FormItem> | ||
| <FormControl> | ||
| <Input | ||
| type="number" | ||
| value={value ?? ""} | ||
| onChange={(e) => { | ||
| const value = e.target.valueAsNumber; | ||
| const parsedValue = Number.isNaN(value) ? null : value; | ||
| onChange(parsedValue); | ||
| }} | ||
| className="w-20" | ||
| /> | ||
| </FormControl> | ||
| <FormMessage /> | ||
| </FormItem> | ||
| )} | ||
| /> | ||
|
|
||
| <Button | ||
| type="submit" | ||
| disabled={form.formState.isSubmitting || !form.formState.isDirty} | ||
| > | ||
| Save | ||
| </Button> | ||
| </div> | ||
| ); | ||
| }; |
5 changes: 5 additions & 0 deletions
5
apps/webservice/src/app/[workspaceSlug]/(app)/policies/[policyId]/edit/concurrency/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { EditConcurrency } from "./EditConcurrency"; | ||
|
|
||
| export default function EditConcurrencyPage() { | ||
| return <EditConcurrency />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
apps/webservice/src/app/[workspaceSlug]/(app)/policies/create/_components/Concurrency.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { | ||
| FormControl, | ||
| FormField, | ||
| FormItem, | ||
| FormMessage, | ||
| } from "@ctrlplane/ui/form"; | ||
| import { Input } from "@ctrlplane/ui/input"; | ||
|
|
||
| import { usePolicyContext } from "./PolicyContext"; | ||
|
|
||
| export const Concurrency: React.FC = () => { | ||
| const { form } = usePolicyContext(); | ||
| return ( | ||
| <div className="space-y-6"> | ||
| <div className="max-w-xl space-y-1"> | ||
| <h2 className="text-lg font-semibold">Concurrency</h2> | ||
| <p className="text-sm text-muted-foreground"> | ||
| Control the number of concurrent deployments | ||
| </p> | ||
| </div> | ||
|
|
||
| <FormField | ||
| control={form.control} | ||
| name="concurrency" | ||
| render={({ field: { value, onChange } }) => ( | ||
| <FormItem> | ||
| <FormControl> | ||
| <Input | ||
| type="number" | ||
| value={value ?? ""} | ||
| onChange={(e) => { | ||
| const value = e.target.valueAsNumber; | ||
| const parsedValue = Number.isNaN(value) ? null : value; | ||
| onChange(parsedValue); | ||
| }} | ||
| className="w-20" | ||
| /> | ||
| </FormControl> | ||
| <FormMessage /> | ||
| </FormItem> | ||
| )} | ||
| /> | ||
| </div> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
💡 Verification agent
🧩 Analysis chain
Verify color accessibility and contrast.
The yellow color scheme looks appropriate, but ensure the
text-yellow-400provides sufficient contrast against the background for accessibility compliance, especially in different themes (light/dark mode).Also applies to: 92-94
🌐 Web query:
💡 Result:
WCAG Contrast Ratio Requirements for Text
Contrast Ratio Requirements
Contrast Performance of
text-yellow-400(TailwindCSS) on Typical Backgroundstext-yellow-400in TailwindCSS is#facc15, a light yellow shade.On Light Backgrounds (e.g.,
#ffffffor #f8fafc)text-yellow-400on light backgrounds for any accessible text[5][9].On Dark Backgrounds (e.g.,
#000000or #18181b)text-yellow-400is accessible for both normal and large text on very dark backgrounds[5][9].Key Points and Practical Advice
Summary Table
References
Conclusion:
text-yellow-400passes WCAG contrast on dark backgrounds but fails on light backgrounds for all text sizes. Always check your text/background combination with a contrast checker for compliance.Citations:
Ensure WCAG Contrast for
text-yellow-400in Both Light and Dark ThemesBased on WCAG 2.2:
#facc15yields ~1.17:1 (fails AA/AAA for normal and large text).#facc15yields ~13.33:1 (passes AA/AAA).Action Items:
text-yellow-400in• apps/webservice/src/app/[workspaceSlug]/(app)/policies/(sidebar)/_components/rule-themes.tsx at lines 70 and 92–94.
text-yellow-600or higher) or adjust the background to meet ≥4.5:1 contrast.#facc15already passes.🤖 Prompt for AI Agents
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.
we don't care about accessibility I fear
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.
@adityachoudhari26 Understood! I'll keep that in mind for future reviews and won't flag accessibility contrast issues going forward.
✏️ Learnings added