-
Notifications
You must be signed in to change notification settings - Fork 75
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
[cms] Replace DCC cache usage with direct gitbe implementation #1300
Conversation
way for tlog implementation. We also add a testrun check for vote summary to back sure that the votes are being tabulated correctly.
politeiad/backend/gitbe/cms.go
Outdated
|
||
// pluginLoadDCCVoteResults is a pass through function. CmdLoadDCCVoteResults does | ||
// not require any work to be performed in gitBackEnd. | ||
func (g *gitBackEnd) pluginLoadDCCVoteResults() (string, error) { |
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.
This function doesn't do anything. Why?
politeiad/backend/gitbe/gitbe.go
Outdated
payload, err := g.pluginLoadDCCVoteResults() | ||
return cmsplugin.CmdLoadVoteResults, payload, err | ||
case cmsplugin.CmdDCCVotes: | ||
payload, err := g.pluginDCCVotes(payload) |
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.
The command name is dccvotes
, the function name is pluginDCCVotes
, but the corresponding plugin struct is named VoteResults
. This is confusing. The naming should be consistent.
politeiad/backend/gitbe/cms.go
Outdated
} | ||
|
||
// git checkout master | ||
err = g.gitCheckout(g.vetted, "master") |
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.
Plugins should use the Backend
api when possible instead of interacting with git and the filesystem directly. For metadata streams like in this function you should be able retrieve the full record with GetVetted
and then pull out the mdstreams that you need from Record.Metadata
. The same applies to the DCCVoteDetails
function.
The only time a plugin should interact with the filesystem directly is when it needs journal data, since there aren't any Backend
methods for interacting with the journals.
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.
ACK
This diff removes the remaining DCC references to the cache and now directly requests the
vote information from the gitbe. This clears the way for easier implementation of tlog
since it will no longer be using the cache as we have it now.