Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Conversation

@borekb
Copy link
Member

@borekb borekb commented Jun 1, 2016

Resolves most of #1036.

Progress: #1075 (comment)

Update 4th Oct 2016: We're mostly done with this, some smaller things have been moved to separate issues and are linked from #1075 (comment). If you want to provide feedback, please read Plugin-Support.md and leave a comment.

borekb and others added 2 commits June 3, 2016 15:18
@JanVoracek JanVoracek force-pushed the 1036-plugin-support branch from 8d85892 to c5caaff Compare June 3, 2016 13:22
@JanVoracek JanVoracek self-assigned this Jun 3, 2016
@JanVoracek JanVoracek added this to the 4.0 milestone Jun 3, 2016
@vasek vasek closed this Jul 11, 2016
@vasek vasek deleted the 1036-plugin-support branch July 11, 2016 11:55
@JanVoracek JanVoracek restored the 1036-plugin-support branch July 11, 2016 12:13
@JanVoracek
Copy link
Contributor

Closed by mistake; reopening.

@JanVoracek JanVoracek reopened this Jul 11, 2016
@borekb
Copy link
Member Author

borekb commented Oct 3, 2016

Here are some notes as I reviewed Plugin-Support.md:

  • It would be good to have a clear name for the set of files in the .versionpress folder. "Plugin definition" is the best I can currently think of.
    • Yes let's go with "plugin definition", that's fine.
  • We have been using the edit action since VersionPress 1.0 (e.g., option/edit), however, the more natural English verb is update. 4.0 would be a chance to fix this. (Feedback from native speakers welcome.)
  • Do we need the separate _meta_ entity filters, e.g., vp_entity_tags_ vs. vp_meta_entity_tags_? I get that they are slightly different, however, if a single filter name could be used for both cases, it would make the API smaller.
  • Is "schema" the right word? Our schema.yml contains quite a bit more. On the other hand, "schema" is quite unique and intuitively connected to a database so it might be OK to call it that.
    • We could not come up with a better alternative.
  • .versionpress makes sense in the plugin folder but for the planned online repo, we need a convention to separate the plugins. See e.g. DefinitelyTyped.
    • Something like plugin's slug will be used.
  • Our term "actions" conflicts with WP actions. Not be a big deal for us but WP developers unfamiliar with VersionPress might be confused. If needs be, we can consider "events" instead.
  • Document the slash in Actions

- Hooks are defined in `hooks.php`

All files are optional so for example, if a plugin doesn't define any new shortcodes it can omit the `shortcodes.yml` file. Simple plugins like _Hello Dolly_ might even omit everything; they just need to have the `.versionpress` folder so that VersionPress knows the plugin is supported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will VP versioning mechanism handle this Empty folder ? Empty folders are not versioned by default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know. Originally, I didn't intend to use this directory to let VP know if the plugin is supported. It's maybe question to @borekb.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.gitkeep is an option but it's true that we didn't discuss this yet. The empty .versionpress folder seemed to me like the easiest way for a plugin author to declare explicit support for VersionPress even if no definitions are necessary.

Or maybe it could be a .versionpress file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be some service. The main reason is that you don't have the files before you install the plugin; therefore, you cannot say whether the plugin is supported or not on the /plugin-install.php page.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Let's talk about this later, seems like a relative detail.

```yaml
post:
table: posts
id: ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about multi column id ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VersionPress doesn't support it yet.

### Non-database actions

Some actions are not directly related to the database entities, e.g. plugin installation, WP update, etc. VersionPress provides function `vp_force_action` for these actions. VersionPress will use only action specified by parameters of this function and ignore all automatically catched. For example:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add note that priority is ignored when action is forced.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not only the priority – the actions are ignored entirely. Do you have any suggestion how to reword the sentence?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to look at this section anyway ("catched" etc.), will try to reword it.

Copy link
Contributor

@JanVoracek JanVoracek Oct 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need an emoji for 🤦 ... catched 🙄

public function getPriority()
{
return $this->commitMessage->getUnprefixedSubject();
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When no better is found, why priority is not high instead ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UntrackedChangeInfo represents manual commit; thus, there are no other ChangeInfo objects to compare with. Plus, ignoring the fact it will not compare with anything, zero is the highest priority.

borekb and others added 2 commits October 4, 2016 00:50
- Removed section about how VersionPress stores actions in commit messages (it didn't bring enough value for its length)
- More clearly described what an action is and what it consists of
- There is now clearer distinction between database and non-database actions
- Filters are just mentioned but their signature is not described
- Some other smaller edits
# Conflicts:
#	plugins/versionpress/composer.lock
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants