[Feature] Add `graphman unlink`
@zorancv đang làm issue này rồi.
Từ ngày 1/12/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Description
Add a command that takes an IPFS hash and removes that deployment from all subgraph names that are using it as their current or pending version. In more detail: if a subgraph uses the hash as its current version, set current_version = pending_version and pending_version = null. If it uses it as the pending version, set pending_version = null.
This command should only accept an IPFS hash, not a subgraph name or sgd identifier.
Currently, this is done with the following pl/pgsql proc which also maintains an auditing table info.deleted_subgraphs; it would be good to keep this auditing, too. The code would have to create the table if it does not exist yet.
create or replace function unlink_deployment(did text)
returns void as
$$
declare
sg record;
begin
-- We only handle current and pending versions, even though the code
-- talks about unuded versions for simplicity. We filter unused versions
-- out in the queries.
insert into info.deleted_subgraphs(id, name, sid, version,
deployment, namespace, shard,
subgraph_created_at, version_created_at)
select ds.id,
s.name,
s.id as sid,
case when v.id = s.current_version then 'current'
when v.id = s.pending_version then 'pending'
else 'unused' end as version,
ds.subgraph as deployment,
ds.name as namespace,
ds.shard,
to_timestamp(s.created_at) as subgraph_created_at,
to_timestamp(v.created_at) as version_created_at
from subgraphs.subgraph s,
deployment_schemas ds,
subgraphs.subgraph_version v
where v.subgraph = s.id
and v.id in (s.current_version, s.pending_version)
and ds.subgraph = v.deployment
and v.deployment = did;
for sg in
select s.id as sid,
case when v.id = s.current_version then 'current'
when v.id = s.pending_version then 'pending'
else 'unused' end as version,
case when v.id = s.current_version then 1
when v.id = s.pending_version then 0
else 2 end as sort_key
from subgraphs.subgraph s, subgraphs.subgraph_version v,
deployment_schemas ds
where s.id = v.subgraph
and v.id in (s.current_version, s.pending_version)
and ds.subgraph = v.deployment
and v.deployment = did
order by sort_key
loop
if sg.version = 'current' then
update subgraphs.subgraph
set current_version = pending_version,
pending_version = null
where id = sg.sid;
elsif sg.version = 'pending' then
update subgraphs.subgraph
set pending_version = null
where id = sg.sid;
end if;
end loop;
end;
$$ language plpgsql;
Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.
No response
Some information to help us out
- Tick this box if you plan on implementing this feature yourself.
- I have searched the issue tracker to make sure this issue is not a duplicate.
- Ngôn ngữ chính
- Rust
- Star
- 3.2k
- Fork
- 1.1k
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của graphprotocol/graph-node
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
graphprotocol/graph-node#6719 ·
-
RUSTSEC-2026-0194: Quadratic run time when checking a start tag for duplicate attribute names Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
graphprotocol/graph-node#6673 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
graphprotocol/graph-node#6650 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
graphprotocol/graph-node#6722 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
graphprotocol/graph-node#6721 ·
Tất cả issue của graphprotocol/graph-node
Issue tương tự
-
risk:low runtime status:in-progress type:test
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
EricSpencer00/Resilient#4835 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
bisq-network/bisq-musig#204 ·
-
agent:ready documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cesarferreira/stax#890 ·