If you have ever created or used an actor, you may have noticed that actors have builds. A build is basically a particular snapshot of the actor stored on the Apify cloud. More specifically, each build is a Docker image that is used to start the container (actor run). Fortunately, Apify hides this implementation detail from you so you don't need to understand Docker, images and containers at all. You can find more details about that in our docs.
Builds have this very cool feature that even if you have just created a new build of your actor, you can choose to run any of your historical builds. This gives you the freedom to experiment with code or dependencies, since you know the older builds will keep working without being affected. You can also fork and tag your builds so that you create more distinct versions, such as
But if you want to publish your actor, things get a little more complicated. When you're the only user of your actor, you have full control over releasing new versions and keeping your integrations working. But a user of any public actor is completely in the hands of the actor creator. He or she can release breaking changes at any time and break your integration. Yes, you can technically fix the complete build version of the actor you want to use (e.g. to
0.0.15), but then you lose the ability to benefit from any improvements.
In this article, we will present best practices for you as an actor publisher so that your users can benefit from your actor updates but still be safe.
No-versioning - just use "latest"
The default way of building actors is simply to increment the
latest tag as your last build. If you build your actor for the first time, the build will have the number
0.0.1 and the tag
latest. If you build it again, the new number will be
0.0.2 and the
latest tag will move to this new build. You can see all builds with their tags in the Builds tab.
Any user that wants to run this actor will use the build with
When to use no-versioning?
- The actor will likely not change in the future.
- The interface (input/output) of the actor is so simple that it will likely never change.
- The actor has a simple one-off usage and is not used for integration (such as example actors)
For any other use case, we would highly recommend that you use versioning for your published actors. Users will see that as a sign of stability and long-term vision.
Versioning of public actor with tags
The first rule of our versioning practice is to never use the
latest tag. Since every build can have only one tag, we want this tag to describe a particular version.
Before you do your first build, go to the Source tab of your actor and re-tag your current version. We will use notation
version-0-0 for builds starting with
0.0 but you can choose your own tagging system, e.g. a simple increment like
Then you also need to update the default version new users will use. This will usually be the newest version. For now, we only have
version-0-0 . Go to the Settings tab and update it.
Non-breaking changes are those that do not change the public interface (input/output) or the functionality of the actor - usually bug fixes, performance improvements or changes of an underlying technology.
For those changes, you can simply keep building the actor with the same version tag, simply incrementing the last build number automatically, such as
Don't forget to include these changes in your change-log to keep your users informed.
If you want to publish a version that changes the public interface or the overall functionality, you should give it a different tag. This will help all current users keep their working integrations and all your new users can start with the new version right away.
Go to the Source tab and click on fork. Choose version
Now you can build the actor. Don't forget to then tag this version as
version-0-1 and change the default version (tag) in Settings. You should also update the change-log in your README.md so that your users know what changes each version brings.
Once your actor reaches long-term stability, you can release a version
1.0 . Then for any big change of the actor, you should update the major part of the version number, e.g.
3.0 , etc.
Automatic notification about new version
Note that this notification has not yet been implemented.
If you publish a new version of your actor, all users of your actor will be notified about this. They can then choose if they want to upgrade. All new users will start with the version that is defined in the Settings -> Default run options.
How to start versioning for an already published actor
Some of you may have already published an actor and would like to start the versioning practice presented above. It doesn't matter if you used only
latest tag or some other system. You just need to fork your current version, tag it and start using the new system. It doesn't matter that much whether you start with
1.0 . If you previously used the default
latest tag, it might become a bit confusing if you still have this tag for an older version, but from now on it should be clear that the versions keep incrementing.