You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+42-7Lines changed: 42 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This repository produces container images for data-centric development on Google Cloud Platform. The images include Terraform, Google Cloud SDK, and Python. They are designed for use in GitHub Codespaces and GitHub Actions.
4
4
5
-
**Always review `GEMINI.md`for complete project information, goals, and principles.**
5
+
The container images are used for data processing systems using Python, dbt and GCP. The README file and any other documentation must always reflect what the repository does and how it works. Changes to the README file can be proposed, but must be carefully considered to minimise impact to consumers.
6
6
7
7
## Project goals and principles
8
8
@@ -14,6 +14,12 @@ This repository produces container images for data-centric development on Google
14
14
- Use sentence case for headings, labels, and badges
15
15
- Make minimal changes - don't reformat code unnecessarily
16
16
- Ensure README and documentation always reflect what the project actually does
17
+
- Where possible, ensure that a push to GitHub Actions is not required to exercise and test things and instead capabilities and features can be tested interactively first
18
+
- The number of dependencies must be minimised
19
+
- Trust for a dependency must be determined primarily based on the methods described at https://snyk.io/advisor
20
+
- Trusted maintainers and suppliers take responsibility for the transitive dependencies of their projects. Only direct dependencies need to be considered
21
+
- Each dependency must be annotated at point of inclusion with a comment declaring the maintaining party
22
+
- A list of all direct dependencies and maintaining parties must be called out in a README section
17
23
18
24
## Agent environment
19
25
@@ -42,16 +48,46 @@ The CI/CD pipeline (`.github/workflows/docker-publish.yml`) automatically builds
42
48
- All dependencies must automatically update to latest versions when the image is built
43
49
- Every dependency must be annotated with its maintaining party
44
50
- Only add software from explicitly trusted maintainers
45
-
- Python packages must have a Snyk Advisor package health score greater than 80
46
-
- Review the detailed rules in `prompts/rules/03-supply-chain-security.md`
51
+
- Python packages must have a Snyk Advisor package health score greater than 80 (check at https://snyk.io/advisor/python/packagename)
52
+
- NEVER ADD ANY SOFTWARE FROM A MAINTAINER THAT IS NOT EXPLICITLY TRUSTED
53
+
- Dependencies include: GitHub actions, Docker base images, operating system packages, installed libraries and applications, Python packages, and dbt packages
47
54
48
55
## Code style and contribution guidelines
49
56
50
-
- Follow rules documented in `prompts/rules/` directory
51
-
- Bash scripts must follow practices in `prompts/rules/01-bash-scripting-rules.md`
52
-
- Dockerfile changes must follow `prompts/rules/02-dockerfile-best-practices.md`
53
57
- Commit messages should describe **why** the change was made, not what was changed
54
58
- Test interactively before pushing to GitHub Actions when possible
59
+
- Keep responses concise and to the point
60
+
61
+
### Bash scripting
62
+
63
+
- Write scripts that are reliable, maintainable, and secure
64
+
- Scripts should be idempotent, meaning they can be run multiple times with the same outcome
65
+
- Use `set -euo pipefail` to make scripts more robust (fail fast, treat unset variables as errors, fail on pipeline errors)
66
+
- Always start scripts with `#!/bin/env bash` to specify the interpreter
67
+
- Use comments to explain complex logic
68
+
- Break down code into functions to avoid repetition
69
+
- Use clear and descriptive variable names
70
+
- Never hardcode secrets - use environment variables or a secure vault
71
+
- Validate inputs to prevent command injection
72
+
- Use absolute paths for files and commands
73
+
- Use tools like `shellcheck` to identify potential issues
74
+
- Implement logging to help with debugging
75
+
76
+
### Dockerfile best practices
77
+
78
+
- Dockerfiles should be clear, concise, and easy to understand
79
+
- Images should be as small as possible while still containing all necessary dependencies
80
+
- Security is a primary concern; images should be secure by default
81
+
- Use official and trusted base images
82
+
- Default to a rolling tag like `latest` or `rolling` to ensure base images are continuously updated (trades stability for security)
83
+
- Employ multi-stage builds to separate build-time dependencies from runtime dependencies
84
+
- Minimize the number of layers by combining related commands
85
+
- Use a `.dockerignore` file to exclude unnecessary files
86
+
- Avoid running containers as the root user - create and switch to a non-root user
87
+
- Each new command should be on a new line with appropriate continuation characters (`\` and `&&`)
88
+
- Use `COPY` instead of `ADD` unless you need ADD's specific features
89
+
- Keep image dependencies to a minimum
90
+
- Never store secrets in Dockerfiles
55
91
56
92
## Code quality and refactoring
57
93
@@ -74,7 +110,6 @@ The AI performing a pull request review is an expert in modern engineering pract
74
110
75
111
Code reviews must include:
76
112
77
-
- review of `GEMINI.md` to understand the goals and style of the project
78
113
- a review of what has changed for any security issues or improvements that could be made
79
114
- whether the `CHANGELOG.md` file includes the current PR. If it does not, the reviewer should propose an entry for the PR, following the layout and content of existing entries
80
115
- whether the `README.md` file reflects what the project actually does
0 commit comments