Skip to content

Commit de64dc4

Browse files
committed
ci: update rules, details and documentation about GenAI use and OpenAI Codex product
And use last develop version of Swift Package Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent b55a39d commit de64dc4

File tree

5 files changed

+58
-82
lines changed

5 files changed

+58
-82
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ NOTICE.txt @pylapp @ludovic35
4141

4242
README.md @ludovic35 @pylapp
4343

44+
AGENTS.md @pylapp
4445
THIRD_PARTY.md @pylapp
4546
renovate.json @pylapp

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ Signed-off-by: Tayeb Sedraia <[email protected]>
243243
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
244244
```
245245

246-
Finaly, if you want to note somewhere you used *generative AI* tool, you can add the field "Assisted-by" in your commit with the model in use and in parenthsies some commercial name.
246+
Finaly, if you want to note somewhere you used *generative AI* tool, you can add the field "Assisted-by" in your commit with the model in use and in parenthesis some commercial name.
247247

248248
```text
249249
feat: add thousands of tokens (Orange-OpenSource/ouds-ios#123)
250250
251251
Add thousands of tokens and hundreds of tests.
252252
253-
Assisted-by: GPT-4o-mini (Dinootoo)
253+
Assisted-by: GPT-4o-mini (Orange Dinootoo)
254254
```
255255

256256
## Developer Certificate of Origin

.github/DEVELOP.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
- [Update of dependencies](#update-of-dependencies)
3434
- [Update 3rd parties](#update-3rd-parties)
3535
- [CI/CD](#cicd)
36+
- [Use of GenAI](#use-of-genai)
37+
* [Note in commits](#note-in-commits)
38+
* [OpenAI Codex](#openai-codex)
3639

3740
## Technical preconditions
3841

@@ -734,3 +737,34 @@ However of course you will have to define all the variables, secrets and have th
734737
You can find more details about the pipelines, how to set up runners and scripts to use [in the wiki](https://github.com/Orange-OpenSource/ouds-ios-design-system-toolbox/wiki/51-%E2%80%90-About-continuous-integration-and-delivery).
735738

736739
In few words, there is a pipeline containing some stages and HIRDjobs to build alpha, nightly/beta and production releases.
740+
741+
## Use of GenAI
742+
743+
### Note in commits
744+
745+
The use of generative artifical intelligence (in short "GenAI") is not forbidden.
746+
However, to keep records of this new usage, contributors and maintainers must add inside the commit body if they use GenAI, which model and how.
747+
Indeed GenAI can be used to generate source code and also review pull requests.
748+
In all cases, the field *Assisted-by* must be added with the Large Language Model ("LLM") name and product.
749+
750+
For example, if the Orange tool named _Dinootoo_ has been used with GPT-4o-mini as LLM to generate some code:
751+
752+
```text
753+
Assisted-by: GPT-4o-mini (Orange Dinootoo)
754+
```
755+
756+
Or if the Codex product has been used to make some pull request reviews or to work on issues, using the GitHub Connector (see [here for LLM for Codex cloud details](https://openai.com/fr-FR/index/introducing-codex/)):
757+
758+
```text
759+
Assisted-by: codex-1 (OpenAI Codex)
760+
```
761+
762+
The main things to note are the LLM in use and the products bebind with, if relevant, company name to have no doubt.
763+
764+
### OpenAI Codex
765+
766+
You may notice [Codex (OpenAI product)](https://chatgpt.com/codex) is used. Indeed this product can be integrated to GitHub repositories thanks to environments and [ChatGPT Plus, Pro, Business, Edu, and Enterprise plans](https://developers.openai.com/codex/quickstart). We do not use [codex GitHub Action](https://github.com/openai/codex-action) nor the [lightweight terminal agent](https://github.com/openai/codex) but the [GitHub ChatGPT Codex Connector](https://developers.openai.com/codex/cloud).
767+
768+
For any commits or content provided by Codex, apply the same rules as explained previously.
769+
770+
Keep in mind the repositories of OUDS iOS (Swift Package and design system toolbox) are two different enviroments. Thus you must not ask Codex to work on an issue for the design toolbox, as the issues are all gathered in the Swift Package repository (to help manaement of projects and milestones); Codex will try to work for the app on the package which is not acceptable and won't work. However Codex can be used for pull requests reviews and to work on issues (for Swift Package repo only so). To use Codex, mention `@codex` and it will react.

AGENTS.md

Lines changed: 20 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
# Agents.md
1+
---
2+
type: ai-agent-guide
3+
framework: OUDS-iOS-Design-System-Toolbox
4+
language: Swift
5+
ui-framework: SwiftUI
6+
platforms: [iOS, iPadOS, macOS, visionOS, watchOS, tvOS]
7+
min-deployment: iOS 15.0
8+
---
9+
10+
# OUDS iOS Design System Toolbox app - AI Agent Guide
211

312
This file provides guidance to AI coding agents when working with code in this repository or with OUDS iOS products.
413

@@ -20,6 +29,7 @@ The products are written in Swift with SwiftUI as UI framework and Swift 6 (form
2029
- *theme*: a set of tokens, assets like fonts and images, to use in app to style it and change their look and feels
2130
- *tuning*: some small configuration elements for a theme like rounded corners
2231
- *token provider*: an object in a theme gathering tokens (semantics and components)
32+
- *component*: mainly a SwiftUI view with specific features and layouts like buttons, switch, link etc.
2333

2434
## Code formating
2535

@@ -229,82 +239,13 @@ To update the build number of the app:
229239
bundle exec fastlane update_build_number
230240
```
231241

232-
## Code samples
233-
234-
### Import OUDS product
235-
236-
Import OUDS umbrella product gathering all other librairies:
237-
```swift
238-
import OUDSSwiftUI
239-
```
240-
241-
### Instanciate a theme object
242-
243-
Create a theme for Orange product:
244-
```swift
245-
let theme = OrangeTheme()
246-
```
247-
248-
### Inject a theme in an app
249-
250-
Use an `OUDSThemeableView` to inject the theme:
251-
252-
```swift
253-
OUDSThemeableView(theme: theme) {
254-
255-
}
256-
```
257-
258-
### Get the theme object
259-
260-
Get the theme object as environement object:
261-
```swift
262-
@Environment(\.theme) private var theme
263-
```
264-
265-
### Use tokens from theme
266-
267-
Use colors (semantic tokens) defined in a theme:
268-
```swift
269-
theme.colors
270-
```
271-
272-
Use borders (semantic tokens) defined in a theme:
273-
```swift
274-
theme.borders
275-
```
276-
277-
Use fonts (semantic tokens) defined in a theme:
278-
```swift
279-
theme.fonts
280-
```
281-
282-
Use sizes (semantic tokens) defined in a theme:
283-
```swift
284-
theme.sizes
285-
```
286-
287-
Use spaces (semantic tokens) defined in a theme:
288-
```swift
289-
theme.spaces
290-
```
291-
292-
Use dimensions (semantic tokens) defined in a theme:
293-
```swift
294-
theme.dimensions
295-
```
296-
297-
Use elevations (semantic tokens) defined in a theme:
298-
```swift
299-
theme.elevations
300-
```
301-
302-
Use grids (semantic tokens) defined in a theme:
303-
```swift
304-
theme.grids
305-
```
242+
## Review guidelines
306243

307-
Use opacities (semantic tokens) defined in a theme:
308-
```swift
309-
theme.opacities
310-
```
244+
- Check if sources are formatted
245+
- Run linter, no error must appear
246+
- Run tests, they must all pass
247+
- Check if there is dead coden and leave a comment saying the elements which seem toi be dead / not used
248+
- Build documentation, no error must appear
249+
- Check leaks, no leak must appear
250+
- Check if functions are too long or too complicated, must be low
251+
- Check if the commit has been designed-off (i.e. DCO appplied) by all commits authors

DesignToolbox/DesignToolbox.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)