Kremlin leader Mikhail Gorbachev, on his first foreign visit since becoming Soviet party chief last month, arrived in Warsaw today along with top Eastern European officials in preparation for a meeting Friday to renew the Soviet Bloc's military alliance.

Heads of the communist parties and governments of all seven Warsaw Pact countries have gathered to extend the treaty signed 30 years ago that binds the Soviet Union and Eastern European states to defend one another in the event of outside attack.

Ratified the same year West Germany joined NATO, the treaty reportedly is to be reaffirmed for another 20 years, with the option to prolong it for a further 10 years if necessary -- the same formula stipulated in the original document.

The newly elected Gorbachev is expected to use Friday's session as a personal platform to show himself in command of the alliance and to reinforce Soviet initiatives on disarmament. The meeting also will afford the leaders of Poland, Hungary, Czechoslovakia, East Germany, Romania and Bulgaria a chance to take a closer look at the new Soviet chief, who earlier met his Warsaw Pact counterparts at the funeral of his predecessor, Konstantin Chernenko, in Moscow.

Reflecting the importance of the gathering, Gorbachev was accompanied by a delegation of high-ranking Soviet officials, including veteran Foreign Minister Andrei Gromyko, Premier Nikolai Tikhonov, the defense minister, Marshal Sergei Sokolov, and Central Committee Secretary Konstantin Rusakov.

The decision to hold the signing ceremony in Warsaw was welcomed warmly by Polish officials who hope the world will see it as a sign of Soviet Bloc approval of progress made in restoring communist authority following the suppression of the Solidarity free trade union more than three years ago.

Although Warsaw was the most logical place for a meeting to renew a pact that bears this capital's name, western diplomats had speculated that communist leaders might have doubts about the ability of General Wojciech Jaruzelski, the Polish leader, to maintain order during the gathering.

Communist officials have cited the recent deployment of new U.S. nuclear missiles in Western Europe and deadlock at East-West arms control talks as necessitating continuation of the Soviet-led military organization.

The Soviet Bloc allies are expected to repeat their standing offer to dissolve the Warsaw Pact if NATO also disbands. NATO, which links the United States with Canada and Western Europe in a web of military commitments, has no time limit.

Eastern European sources said Friday's session is a scaled-down version of a summit originally planned for Sofia last January but postponed due to the illness of Chernenko, whose death was announced March 11. Another meeting of senior Warsaw Pact officials is expected later to deal more extensively with policy and organizational matters, the sources said.

To ensure a peaceful two days until Gorbachev's scheduled departure Saturday, Polish authorities have blanketed the city with police patrols in what amounts to the heaviest militia presence since the early days of martial law.

Gorbachev is the first Soviet leader to visit Poland since the late Leonid Brezhnev came in 1974, and he seemed intent on making a friendly impression. Polish television showed him shaking the hands of well-wishers at Warsaw's Okecie Airport.