-
Notifications
You must be signed in to change notification settings - Fork 0
updated sdic to not print anything and use the logging module, ran black #7
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
Open
dimitrylukashov
wants to merge
9
commits into
master
Choose a base branch
from
AI_432_sdic_papertrail
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
adc8ce2
updated sdic to not print anything and use the logging module, ran black
dimitrylukashov 3f1e49f
change the mdl rules
dimitrylukashov 3a335ca
added mdlrc
dimitrylukashov f9889c1
added black
dimitrylukashov a4b360f
added mdl language to codeblocks
dimitrylukashov 9a4e30a
wip
dimitrylukashov bf03fa5
wip
dimitrylukashov faa1ce3
wip
dimitrylukashov e5a4766
correctly runs through sdic, needs cleanup and tests
dimitrylukashov 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| all | ||
| rule 'MD013', :code_blocks => false |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ This works for simple constraints: | |
| 1. It's easy to implement | ||
| 1. It's cheap for the database to check on every change | ||
|
|
||
| But for more complex constraints that you'd like to set, it'd be either very | ||
| But for more complex conditions, it'd be either very | ||
| expensinve to check on every write, or even impossible to write as a | ||
| constraint. | ||
|
|
||
|
|
@@ -87,21 +87,23 @@ doctor ordered. | |
|
|
||
| ## Install as a cron | ||
|
|
||
| If you want to get an email every night to give you a list of all the soft | ||
| constraints that have been broken during the last day, just add it to you | ||
| crontab. We like to have it run daily, so we can fix any bug generating bad | ||
| data before it becomes a real problem. | ||
| Run sdic from cron as often as you like, we like to have it run daily. | ||
|
|
||
| Example crontab: | ||
| ## Monitoring | ||
|
|
||
| ``` | ||
| MAILTO="dba@acme.com" | ||
| @daily sdic live | ||
| sdic uses Python's [`logging`](https://docs.python.org/2.7/library/logging.html) | ||
| module to log any output in dot separated hierarchical fashion. | ||
|
|
||
| Any general sdic message would look like this: | ||
|
|
||
| ```console | ||
| Jan 11 00:10:19 <sender> sdic.enforce_fullname: enforce_fullname.sql successfully ran in 0.029 sec | ||
| ``` | ||
|
|
||
| `dba@acme.com` is the email that will get the soft constraints broken every | ||
| day. Make sure your local MTA is well configured on your system. You can test | ||
| it by doing `date | mail -s test dba@acme.com`. | ||
| In Papertrail `sdic.enforce_fullname` will be treated as a | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Papertrail is really specific to us, can you talk about syslog in general instead? |
||
| [program attribute](https://help.papertrailapp.com/kb/how-it-works/search-syntax/#attributes). | ||
| And alert can be created with the search keyword `program:sdic.enforce_fullname` | ||
| to trigger anytime the checker encounters a violated constraint. | ||
|
|
||
| ## Databases supported | ||
|
|
||
|
|
@@ -137,7 +139,7 @@ only run one of them, an optional `server` argument can be passed as well: | |
|
|
||
| If a query produces an output, it will look something like this: | ||
|
|
||
| ``` | ||
| ```console | ||
| -----===== /!\ INCOMING BAD DATA /!\ =====----- | ||
|
|
||
| Server: big-database | ||
|
|
||
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 |
|---|---|---|
| @@ -1 +1 @@ | ||
| VERSION = u'0.2.1' | ||
| VERSION = u'0.2.2' |
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.
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.
Can you use a public image? We don't want to use private stuff in our public repo to prevent leaking (anyone can fork, open a PR, and dump some env vars)