Skip to content

Commit 658cc07

Browse files
committed
add stuff for psconfeu
1 parent 4e4f8ad commit 658cc07

File tree

3 files changed

+148
-1
lines changed

3 files changed

+148
-1
lines changed

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,11 @@
4747
"[markdown]": {
4848
"editor.trimAutoWhitespace": false,
4949
"files.trimTrailingWhitespace": false
50-
}
50+
},
51+
"cSpell.enableFiletypes": [
52+
"powershell"
53+
],
54+
"cSpell.ignoreWords": [
55+
"maxcount"
56+
]
5157
}

CONTRIBUTING.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,100 @@
11
# Contributing
22

33
## TODO
4+
## Welcome
5+
6+
Before we go any further, thanks for being here. Thanks for using dbachecks and especially thanks
7+
for being here and looking into how you can help!
8+
9+
## Important resources
10+
11+
- docs
12+
- bugs
13+
- communicate with the team
14+
- slack
15+
- github discussions?
16+
- presentations\blogs?
417

518
## Running the Tests
619

720
If want to know how to run this module's tests you can look at the [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/#running-tests)
21+
22+
## Environment details
23+
24+
We strongly believe that 'every repo should have a devcontainer' and therefore we've built one
25+
for this project that includes 3 SQL Servers and everything you need to develop and build the
26+
dbachecks module.
27+
28+
It's magic!
29+
30+
### Prerequisites:
31+
32+
In order to use the devcontainer there are a few things you need to get started.
33+
34+
- [Docker](https://www.docker.com/get-started)
35+
- [git](https://git-scm.com/downloads)
36+
- [VSCode](https://code.visualstudio.com/download)
37+
- [`Remote Development` Extension for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack)
38+
39+
### Setup
40+
41+
Once the prerequisites are in place follow these steps to download the repo and start up the
42+
devcontainer. The first time you build the devcontainer it will need to pull down the images
43+
so that could take a hot second depending on your internet speeds.
44+
45+
1. Download the repo from GitHub
46+
```PowerShell
47+
# change directory to where you'd like the repo to go
48+
cd C:\GitHub\
49+
50+
# clone the repo from GitHub
51+
git clone https://github.com/dataplat/dbachecks
52+
53+
# move into the folder
54+
cd .\dbachecks\
55+
56+
# open VSCode
57+
code .
58+
```
59+
60+
754662. Once code opens, there should be a toast in the bottom right that suggests you 'ReOpen in Container'.
61+
1. The first time you do this it may take a little, and you'll need an internet connection, as it'll download the container images used in our demos
62+
63+
### Develop & Build
64+
TODO: sampler instructions - similar to /workspace/developing/Howto.md
65+
66+
### Rebuild
67+
68+
The only way to properly rebuild to ensure that all volumes etc are removed is to open up a console
69+
or PowerShell window outside of the devcontainer and run the following:
70+
71+
```PowerShell
72+
cd \path-of-dbachecks-folder\.devcontainer
73+
74+
docker-compose -f "docker-compose.yml" -p "bitsdbatools_devcontainer" down
75+
```
76+
77+
## How to submit changes:
78+
TODO:
79+
Pull Request protocol etc. You might also include what response they'll get back from the team on submission, or any caveats about the speed of response.
80+
81+
## How to report a bug:
82+
TODO:
83+
Bugs are problems in code, in the functionality of an application or in its UI design; you can submit them through "bug trackers" and most projects invite you to do so, so that they may "debug" with more efficiency and the input of a contributor. Take a look at Atom's example for how to teach people to report bugs to your project.
84+
85+
## Templates:
86+
TODO:
87+
in this section of your file, you might also want to link to a bug report "template" like this one here which contributors can copy and add context to; this will keep your bugs tidy and relevant.
88+
89+
## Style Guide
90+
TODO:
91+
include extensions and vscode settings we use to keep things neat
92+
93+
## Code of Conduct
94+
TODO: maybe beef this out - stolen from data sat repo for now.
95+
96+
We expect and demand that you follow some basic rules. Nothing dramatic here. There will be a proper code of conduct for the websites added soon, but in this repository
97+
98+
BE EXCELLENT TO EACH OTHER
99+
100+
Do I need to say more? If your behaviour or communication does not fit into this statement, we do not wish for you to help us.

developing/PSConfEU demo.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# PSConfEU demo
2+
3+
1. Develop in the source repository
4+
- copy existing check & rewrite - add check to `source/checks/Databasev5.Tests.ps1`
5+
- add configuration to `source/internal/configurations/configuration.ps1`
6+
- `skip.database.pseudosimple`
7+
- `policy.database.pseudosimpleexcludedb`
8+
- add object info to `source/internal/functions/Get-AllDatabaseInfo.ps1`
9+
10+
11+
2. Build the module
12+
```PowerShell
13+
./build.ps1 -Tasks build
14+
```
15+
16+
3. Sampler automatically adds the new version to your path
17+
```PowerShell
18+
get-module dbachecks -ListAvailable | select name, modulebase
19+
```
20+
21+
4. Import new version of the module (if you get a bogus error the first time retry it)
22+
```PowerShell
23+
Import-Module dbachecks -force
24+
```
25+
26+
5. Test out the new code
27+
28+
```PowerShell
29+
# save the password to make for easy connections
30+
$password = ConvertTo-SecureString "dbatools.IO" -AsPlainText -Force
31+
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "sqladmin", $password
32+
33+
$show = 'All'
34+
$checks = 'RecoveryModel'
35+
36+
#$sqlinstances = 'localhost,7401', 'localhost,7402', 'localhost,7403'
37+
$sqlinstances = 'dbachecks1', 'dbachecks2', 'dbachecks3' # need client aliases for this to work New-DbaClientAlias
38+
39+
# Run v4 checks
40+
$v4code = Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check $Checks -legacy $true -Show $show -PassThru
41+
# Run v5 checks
42+
$v5code = Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check $Checks -legacy $false -Show $show -PassThru -Verbose
43+
44+
Invoke-PerfAndValidateCheck -SQLInstances $sqlinstances -Checks $Checks
45+
Invoke-PerfAndValidateCheck -SQLInstances $sqlinstances -Checks $Checks -PerfDetail
46+
Invoke-PerfAndValidateCheck -SQLInstances $sqlinstances -Checks $Checks -showTestResults
47+
```
48+

0 commit comments

Comments
 (0)