question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Track all deployments

See original GitHub issue

Elevator pitch:

Right now, we have https://github.com/ApeWorX/ape/issues/530 which is a design to track deployments as such:

from ape import project 

my_contract = account.deploy(project.MyContract)
project.track_deployment(my_contract) 
my_contract = project.deployments(project.MyContract)[-1]

The line project.track_deployment(my_contract) would add information about this contract deployment to .build/deployments/<ecosystem>/<network>/track_deployments.json

This file would look as such:

{
  "MyContract": [
    "0x40Ee4CfF4d103509cEe0720362b8055Ad65f259b",
    .
    .
    .
  ],
  "NextContract:[
  .
  .
  ],
...
}

This is how the project would keep track of deployments.

Value:

This is for all developers who don’t want to have to write custom scripts to keep track of their deployments.

Dependencies:

I don’t think this has any dependencies.

Design approach:

The main design is in the elevator pitch. But to continue, we may have to adjust the api for local networks. We’d wouldn’t always want the saved deployment to be saved forever on local networks that get destroyed so often:

def track_deployment(contract, persist: bool=true):

Or, we could pull from the ape-config.yaml

name: apeworx-project
contracts_folder: contracts
networks:
  hardhat:
    persist: false

Task list:

  • Deployments can be tracked
  • Tests for deployments written
  • Documentation updates

Estimated completion date:

2 weeks

Design review:

Do not signoff unless:

    1. agreed the tasks and design approach will achieve acceptance, and
    1. the work can be completed by one person within the SLA. Design reviewers should consider simpler approaches to achieve goals.

(Please leave a comment to sign off)

Let me know if this is something I can take a crack at and if the design looks good.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
fubuloubucommented, Jun 17, 2022

So, how’s this for an API:

from ape import project, chain

my_contract = account.deploy(project.MyContract)
project.track_deployment(my_contract) 
my_contract = chain.contracts.MyContract[-1]

or better yet, we just remove the track_deployment line totally, and pull from the ape config on whether or not to track (testnets and public networks default to true, local networks default to false)

Yes, we don’t need track_deployment to use this feature (the use case there is for keeping track of final copies of contracts to be deployed e.g. official releases), maybe let’s do this instead:

from ape import project, chain

account.deploy(project.MyContract)  # Forgot to save the contract type
my_contract = chain.contracts.find_deployments(project.MyContract)[-1]  # But I can get it this way
# NOTE: Has to do a search over the contract cache
#       to find deployments with matching contract type
0reactions
unparalleled-jscommented, Aug 4, 2022

Renamed the issue because there is a separate ticket for tracking deployments for publishing reasons that goes in the .build folder.

This ticket ended up by closed by #856 and was just for all deployments.

I know the history in confusing but otherwise this is duplicate of https://github.com/ApeWorX/ape/issues/530

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Deployment Tracking?
Deployment tracking is an automated tool that tracks performance of new software releases and quickly identifies any issues. If you have any questions...
Read more >
Viewing deployment activity for your repository
Viewing the deployments dashboard · On GitHub.com, navigate to the main page of the repository. · To the right of the list of...
Read more >
Deployment Tracking Software. Ship With Confidence
Monitor every deployment in real-time and identify errors and performance issues before your customers do. Support for popular deployment tools, or send to...
Read more >
Introduction to deployment tracking
This chapter introduces deployment tracking concepts, and explains how Rational (R) ClearCase (R) and Rational ClearQuest (R) facilitate the deployment ...
Read more >
Easily Track Where Your Work Item Has Been Deployed ...
With this control, you can track where and when your completed work item is being deployed. All from the work itself. Jump To:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found