Skip to content

Commit e7b7ac9

Browse files
committed
chore: add GitHub Copilot instructions for the project
Signed-off-by: Lance Albertson <lance@osuosl.org>
1 parent a2499aa commit e7b7ac9

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Project Guidelines
2+
3+
## Overview
4+
5+
kitchen-openstack is a Test Kitchen driver for OpenStack. It provisions and destroys Nova instances using the Fog OpenStack library.
6+
7+
## Code Style
8+
9+
- Ruby 3.1+ required
10+
- All files must start with `# frozen_string_literal: true`
11+
- Follow Cookstyle (Chef's RuboCop) conventions — config in `.rubocop.yml`
12+
- Spec files are excluded from linting
13+
14+
## Architecture
15+
16+
- Driver class: `Kitchen::Driver::Openstack` in `lib/kitchen/driver/openstack.rb` — extends `Kitchen::Driver::Base` (Driver API v2)
17+
- Volume handling: `Kitchen::Driver::Openstack::Volume` in `lib/kitchen/driver/openstack/volume.rb`
18+
- Version constant: `OPENSTACK_VERSION` in `lib/kitchen/driver/openstack_version.rb` — used by gemspec and release automation
19+
- Configuration uses `default_config` declarations; raise `Kitchen::ActionFailed` for driver errors
20+
21+
## Build and Test
22+
23+
```bash
24+
bundle install
25+
bundle exec rake # runs tests + style + stats (default)
26+
bundle exec rake test # unit tests only (RSpec)
27+
bundle exec rake style # Cookstyle lint
28+
bundle exec rake quality # style + stats
29+
```
30+
31+
## Conventions
32+
33+
- Use `Fog::OpenStack::Compute` and `Fog::OpenStack::Network` for cloud interactions
34+
- Thread safety: use `Mutex` for shared resource pools (e.g., floating IP allocation)
35+
- Resource finders (`find_image`, `find_flavor`, `find_network`) support regex matching via `/pattern/` syntax
36+
- Test with RSpec 3 using `let` fixtures, `double` mocks, and `allow_any_instance_of` for Kitchen internals
37+
- Release automation via Release Please — version bumps go in `lib/kitchen/driver/openstack_version.rb`

0 commit comments

Comments
 (0)